Cost modelling and unit economics
Express infrastructure spend as cost per request, per user and per tenant so architecture choices become business decisions.
14 min readWhy unit cost beats the monthly bill
A cloud bill that grew from 80 000 to 120 000 dollars a month says nothing on its own. If traffic doubled in the same period, unit cost fell by a quarter and the platform is getting more efficient. Unit economics divides spend by a business driver: cost per thousand requests, per active user, per order or per GB stored. It lets leadership compare cost with revenue per unit, and lets engineers see whether a change made the system cheaper or just busier.
Building a cost model
A simple model lists each component's cost drivers and how they scale with load. Some costs are fixed, such as a minimum cluster size or a support contract; most are variable. Separating them matters: fixed costs make unit cost fall as traffic grows, while variable costs set the floor you can never go below. A spreadsheet is enough to start, with one row per component, its pricing unit, current usage and the business driver it scales with. Validate the model against last month's actual bill; if it is more than about 10% off, a driver is missing.
- Compute: instance-hours, driven by peak RPS and utilisation
- Storage: GB-months per tier, plus replicas and backups
- Data transfer: cross-zone and internet egress, often the surprise line item
- Managed services: per request, per GB scanned or per message
- Telemetry: logs and traces can reach 10 to 30% of infrastructure spend if unmanaged
A worked example
An API serves 300 million requests a month. Twelve instances at 0.20 dollars an hour cost about 1 750 dollars a month. The database and replicas cost 2 500, cache 600, logs at 1 KB per request (300 GB indexed) about 900, and egress for 30 TB about 2 700. Total: roughly 8 450 dollars, or 2.8 cents per thousand requests. The model shows immediately that egress and logging together are 42% of cost, so a CDN or response compression and a DEBUG-log filter are worth more than tuning the instances.
Allocation and showback
Costs only fall when the people who cause them can see them. Tag every resource with team, service and environment, attribute shared platform costs by usage (CPU-seconds, GB ingested, requests), and publish cost per team and per service monthly. In multi-tenant systems, go one step further and estimate cost per tenant, because a few customers often drive most of the load, and pricing must reflect that. Showback (reporting) usually comes before chargeback (billing teams internally); visibility alone often cuts waste by 10 to 20%.
Key takeaways
- Track unit cost against a business driver, not the total bill
- Egress and telemetry are common hidden cost drivers
- Tag and attribute every resource so teams see the cost they cause
Sign in to track lessons and earn badges.