The Bill Is the Architecture
There is a particular experience of opening a cloud invoice and not recognising the system it describes. The line items are real, the usage is real, and none of it corresponds to the architecture diagram anybody would draw.
That gap is the useful thing. The invoice is a measurement of what your system does; the diagram is a measurement of what you intended. Where they disagree, the invoice is right.
Reading a bill as a design document
Three questions turn a cost breakdown into an architectural review.
What is the largest line, and is it the thing that produces the value? If your product is a content site and the biggest number is a managed database, you are paying most of your infrastructure budget for a component that serves data which does not change between deploys.
What is billed per-request, and is the request necessary? Egress, function invocations, database connections. Each of these is a per-unit cost attached to something you may be able to do once at build time instead of a million times at read time.
What is billed for existing? Idle capacity, provisioned throughput, a staging environment that has been running since a project that shipped two years ago. These are the cheapest to fix and the easiest to never notice, because they do not correlate with anything you observe.
Scaling cost is a different problem to high cost
A high bill is a budget question. A bill that scales with something you do not control is an architecture question, and only the second one is urgent.
The distinction matters because the remedies are opposite. High-but-flat cost is negotiable, reservable, and can be traded against engineering time. Cost that scales with traffic, or with record count, or with number of environments, is a structural property — and optimising it after the fact usually means changing the shape of the system, which is the expensive kind of change.
Ask of every significant line: what is the multiplier? If the answer is “requests” or “rows” or “regions”, you have a scaling term. If the answer is “one”, you have a rounding error you can deal with later.
The static case is the clearest example
Content that is identical for every reader and changes only when someone edits it has no business being computed per request. Every render is the same render. Every database query returns the same rows. Every cache is a workaround for having asked the question at all.
Build it once, put the files behind a CDN, and the per-request cost goes to approximately the cost of bytes. Not because static hosting is cheap — though it is — but because you have eliminated the multiplier rather than negotiated it down.
The objection is always freshness, and it is usually a smaller problem than it sounds. A scheduled rebuild is a freshness heartbeat: if the content changes daily, rebuild daily; if a record changes, rebuild on merge. What you lose is sub-minute freshness on data that, for most content sites, changes a few times a week.
The three costs that are not on the invoice
The bill undercounts. Three things belong in any honest comparison and appear on no line item:
Operational surface. A managed database is a thing that can be down, can be full, can be misconfigured, can have its credentials leak, and must be patched. Its cost includes every hour anyone spends on those, and those hours arrive at the least convenient times.
Data you now have to protect. The moment a system stores anything about a person, its cost includes backups, retention, deletion, access control and the incident you have not had yet. Not storing it is free in a way that storing it carefully is not.
Migration debt. Every stateful component is a component that has to be moved if you ever leave. The cheapest architecture to change is one where most of the state is a directory of files.
The failure mode worth naming
The specific way this goes wrong is not extravagance. It is defaulting. Somebody picks the managed option because it is the option the tutorial used, the free tier covers it, and the decision costs nothing on the day it is made.
Two years later the free tier has changed, the usage has grown into a pricing tier nobody modelled, and the component is load-bearing for something that never needed it. The cost was not the mistake. The unexamined default was, and the invoice is simply where it eventually became legible.
Read the bill like a code review. It is the only artifact in the whole system that is guaranteed to describe what is actually running.
Read next
The whole archive-
Writing & Content
RSS Is Still the Best API You Can Ship
A feed costs a few dozen lines, requires no keys, no versioning and no support, and gives every consumer — reader, aggregator, script or agent — the same view of your archive. Almost nobody ships one properly.
-
SEO
A Taxonomy Is a Commitment, Not a Filing Convenience
Categories, subcategories and tags look like three flavours of the same idea. They are three different promises about permanence, and confusing them is how a site ends up with two answers to what a page is about.
-
Development
Timezones Are Not a Formatting Problem
A calendar day and an instant in time are different types, and most date bugs are the moment one is silently converted into the other. The fix is not better formatting — it is refusing the conversion.
Keep reading
More on Cloud
Every vertical on this site carries its own writing, its upcoming events and its answers on one page — and the whole archive is available as a feed with a real publication date on every item.