Summary and key takeaways
The governing question. What quantity is metered, and what is the smallest increment you are charged for? Every price has the form billed = ceil(q ÷ g) × g × r. The metered quantity is a proxy for the work, never the work itself. Cost engineering is the study of the gap between the unit you are billed for and the unit you needed.
Four meters. Stock ($/GB-month), occupancy ($/vCPU-hour), flow ($/GB transferred) and event ($/request, $/TB scanned). A vendor meters what is scarce for the vendor, rivalrous and cheap to count. Per-request pricing exists because a resource whose use does not depend on payload size cannot be recovered through a byte meter.
Formulas to remember:
| Formula | Meaning |
|---|---|
| billed = ceil(q ÷ g) × g × r | every price: quantity, granularity, rate |
| effective price = list rate ÷ utilization | compute sells capacity-time; utilization is your problem |
| S* = c_req ÷ c_byte (about 100 KB) | below this object size you pay for the envelope, not the letter |
| idle multiplier ≈ (peak ÷ mean) ÷ ρ_target | the price of variance (about 5× for a bursty, latency-sensitive service) |
| p(read) × retrieval cost < stock saving | when a cold tier wins |
| value = (1 − selectivity) × bytes × rate × frequency | the dollar value of pruning; techniques multiply (40 × 30 × 3 = 3,600×) |
| N* = (B + R × changes + S × T) ÷ saving per query | materialization break-even |
| elastic wins when d × k < 1 | scale-to-zero; d is duty cycle, k the premium |
| headroom = ramp rate × loop delay | autoscaling cannot handle spikes |
| survival = (1 − p)ⁿ | spot gang effect (0.95¹⁰⁰ ≈ 0.6%) |
| commit at the forecast quantile equal to the discount (P40 at 40% off) | an unused committed unit costs the committed price (0.6), a missing one only the discount (0.4) |
Patterns that repeat:
- Granularity mismatch creates amplification, whether the granularity is physical (a flash erase block) or contractual (a 128 KB minimum object size, a 60-second minimum).
- The vendor's fixed cost sets your natural batch size.
- Costs are conserved. Every escape (batching, multiplexing, changing the meter) moves a cost and converts it to latency, correlation risk or forecasting risk.
- Two opposed meters on one granularity parameter give an interior optimum (partition count against scan volume and metadata).
- The meter decides the answer. Compression strength, cache value, materialization and admission control invert at a metering boundary.
- Concurrency hides latency and never money. The small-file problem is economic before it is a performance problem.
- Cost is concentrated in the tail. Performance work is a median exercise; cost work is a tail exercise.
- Elasticity means selling and buying demand risk. On-demand is 2–5× the committed rate; spot is 60–90% below on-demand. The spread is the market price of your uncertainty.
- A control loop cannot regulate faster than its delay. Cost needs a fast inner loop (governors, caps, dry-run estimates) and a slow outer loop (attribution, unit economics, forecasting).
- Attribution granularity cannot exceed isolation granularity.
- Anti-patterns are abstractions succeeding. The remedy is to show the meter at the moment of authorship.
Six corrections of common claims:
- "The cheaper engine is cheaper": not at low utilization.
- "Tiering means colder hardware": it is a contract (an option trade).
- "128 MB is the right file size because of HDFS": historically true, causally dead; two independent forces agree.
- "Egress is why you cannot leave the cloud": exit fees were waived in 2024; remaining lock-in is operational.
- "Scale-to-zero costs nothing when idle": storage and reactivation still bill, and sparse traffic is the worst case.
- "Three-year commitment at 40% saves 40%": with prices falling about 20% a year it saves about a quarter.
Escapes, cheapest first: change the workload, change the meter, change the layout, change the architecture.
The rule that lasts. Conclusions that come from a structure (a ratio, a fixed latency, an asymmetric loss) survive a price change. Conclusions that come from a number in the price list do not.