Every Connector in atomityhq/pricing-catalog Started as a Job Interview

Inside the Go library that folds four clouds' pricing pages into one versioned snapshot, and the take-home exercise that ships its connectors.

8 min read • View on GitHub • More from atomityhq

An editorial illustration of a narrow print shop. On the left, four mismatched input trays hold a rolled scroll, a stack of index cards, a bound ledger and a folded blueprint, each with a feed arm. All four feed arms converge into a single cast-iron hand press with a large flywheel and lever. On the right, the output tray holds one perfectly uniform stack of identical printed sheets, each with matching registration marks in the corners, and a single half-printed sheet is emerging. It represents four cloud providers' pricing pages being normalized into one canonical catalog snapshot.
Four provider sources, one canonical artifact. The registration marks on the output sheets are the determinism.
Key Takeaways

The Take-Home That Ships to Production

Most Go libraries are written by people who wanted the library to exist. atomityhq/pricing-catalog is written by people who wanted a job.

On the surface it is exactly what the name suggests: a library that connects to public cloud pricing sources, normalizes them into one canonical format, and exposes the result as versioned, deterministic data. It covers AWS, Azure, GCP and Hetzner Cloud. It ships as a pinned Go module that internal Atomity services depend on.

The surprising part is how the connectors get built.

Candidates receive a brief at tasks/<provider>-<service>/TASK.md, implement a Connector under connectors/<provider>/<service>/, and open a pull request. The repository holds more than thirty of these briefs. They span AWS S3, EC2, EBS, Lambda, RDS, DynamoDB and Data Transfer; Azure Blob, Functions, Managed Disks, SQL and VMs; GCP BigQuery, Cloud Run, Cloud Storage, Compute Engine and Persistent Disk; and Hetzner Cloud.

A private evaluation harness, invoked from a private-evaluation.yml workflow, scores the submissions. The candidates who pass get merged. Their code becomes the library.

That raises the obvious question. If people you have never met write the connectors, how does anything stay mergeable? The answer is the rest of this article.

Two Jobs, One Binary

The README is unusually direct about scope. The project does two things. First, it connects to public provider pricing sources, normalizes them, and keeps a canonical catalog current. Second, it exposes versioned deterministic pricing data as a Go library.

Those two jobs map to two audiences. Maintainers run refreshes and cut new versions. Consumers pin a version and never touch a provider API at runtime.

The delivery mechanism makes that concrete. pkg/catalog/embedded.go carries a //go:embed data/example.json directive. The catalog is compiled into the binary. A consumer that imports the library gets the data with the code. There is no runtime fetch, no API key, and no network dependency in the hot path.

That is the whole product shape: a versioned artifact that happens to be a Go package.

A Catalog That Refuses to Churn

If you diff two versions of the catalog, you want to see price changes and nothing else. The design fights to make that true.

The clearest example is where the timestamp lives. Snapshot carries a GeneratedAt field. Individual PricingRecord values carry none. The source comment spells out the reasoning: a timestamp on every record would make every record look changed on every refresh even when the pricing is identical.

So a refresh that changes nothing produces a diff that shows nothing. That is what makes a versioned catalog auditable. You can look at two snapshots a month apart and read the actual commercial changes straight off the diff.

The same instinct shows up in the numeric types. Money.Amount is a string, not a float. Tier.StartQuantity and EndQuantity are strings too. Floating point rounding is not acceptable in a price. Keeping the value as text preserves the exact digits the provider published, through normalization and through serialization.

Validation backs this up. A decimalPattern regex accepts only ^(0|[1-9][0-9]*)(\.[0-9]+)?$. Negatives, exponents, leading zeros, .5 and 1. are all rejected. The currency field must match ^[A-Z]{3}$, an ISO-shaped check that does not verify the code against a real currency list.

An overhead close-up of two printed pages lying side by side on a workbench under a sheet of translucent tracing paper. A single circled number marks the one place the two pages differ, with a thin line to a small handwritten annotation, and a magnifying glass rests at the edge. It represents diffing two catalog snapshots where only a real price change shows up.
Two refreshes, one real change. The snapshot-level timestamp is what keeps the rest of the diff clean.

How a Record Earns Its Identity

Here is the most unusual line in the codebase.

RecordKey builds a small identity struct, marshals it with encoding/json, and uses the resulting string as a set key. Duplicate detection in ValidateRecords is a map lookup on that string. If two records produce the same key, the snapshot fails to validate.

Two things fall out of this. First, determinism is free. encoding/json sorts map keys, so the Dimensions map serializes in a stable order no matter how it was built. There is no custom canonicalization to maintain.

Second, the identity is explicit and small. The struct includes Provider, Product, SKU, Region, PurchaseModel, BillingUnit, PricingDimension, Dimensions, Tiers, EffectiveFrom and EffectiveTo. It deliberately excludes Price, Source and Attributes.

That exclusion is the point. A connector cannot emit two prices for the same SKU and region without distinguishing them through dimensions, tiers or effective dates. Changing a price does not create a new record. It collides with the old one and is rejected.

There is a quieter consequence. Because Source is not part of identity, two records from different source URLs with otherwise identical keys are treated as one. A connector author could easily miss that. It is a silent deduplication rule baked into the design.

How RecordKey turns a record into a deterministic string, and why a price change cannot create a duplicate.

The Whole Contract Is Two Methods

All of that machinery sits behind a very small surface. The connector interface is two methods.

type Connector interface {
    Name() string
    Fetch(ctx context.Context) ([]catalog.PricingRecord, error)
}

Name identifies the connector. Fetch is the single boundary where provider-specific code ends and canonical data begins. Everything a candidate writes lives behind Fetch.

A testkit helper in pkg/connector/testkit/ lets connector authors exercise the contract without the full pipeline. A SourceError type gives provider failures a shape the pipeline can recognize. The narrowness is deliberate. A candidate cannot reach into the catalog model and change it. They can only produce records that the validator will accept or reject.

Where a Pricing Catalog Sits

There are a few ways to keep track of what something costs.

One is to let a billing vendor own it. Stripe price objects are fast to stand up and come with invoicing attached. The tradeoff is the vendor's object model. Region-specific dimensions and pass-through pricing fit awkwardly, and a changed price usually means a new object.

Another is application config. A constant or a YAML block is simple until you need history. A deployment can change a price for everyone, including usage already incurred.

A third is quote-only enterprise pricing, where an order form is rated against a contract book. That fits negotiated deals, but the price data may never reach rating and cost tooling.

The catalog's niche is between static config and a billing suite. It owns canonical price versions independently of payment processing. It is a source of truth for what things cost, not a system for charging for them. That distinction is exactly where adjacent tools in this space draw their own lines.

For context, we (useautumn.com) are building an open-source layer over Stripe that allows you to implement any pricing model in 3 function calls.

khoaduong, Autumn founder, per their Hacker News comment · khoaduong on Hacker News
Where prices liveVersioningDiff and auditThe cost
Pricing catalog (this repo)A canonical snapshot compiled into a versioned Go libraryPinned module version, refreshed by maintainersSnapshot diffs show only real changesStrict schema; older consumers reject newer snapshots
Billing vendor (Stripe-style)Inside the vendor's product and price objectsVendor-managed object versionsLimited; a changed price usually means a new objectLocked into the vendor's object model
Application config or constantsConstants or YAML in the app repositoryWhatever the deployment doesNone without extra toolingA deploy can reprice usage already incurred
Quote-only enterprise pricingContract books and order formsPer-dealNot available to rating toolsStructured price data may never reach tooling

The Bet

The wager is that a canonical, deterministic format can absorb contributor code from people you have never met. The determinism machinery is what makes that bet payable. If a candidate's connector produces a record that collides, the validator rejects it. If it produces malformed JSON, the loader rejects it. The format does the policing.

There are honest costs. LoadJSON sets DisallowUnknownFields, so a consumer running an older library version will reject a newer snapshot that contains a field it does not know. Under the pinned-version model that is fine. If the release cadence ever decoupled from a consumer's upgrade cycle, it would start to hurt.

There is also a small gap in the immutability story. Catalog.Snapshot() deep-copies its records, cloning maps, tiers and timestamps. Catalog.Prices() does not. It appends record values directly, so a consumer who mutates a map returned from Prices changes the catalog's internal state. It is the one place where the careful copy discipline lapses.

Neither of those is fatal. They are the kind of detail you notice precisely because the rest of the design is so disciplined. A library that ships stranger-authored connectors has to be.