Cloud unit economics: stop looking only at the bill and measure cost per transaction
How to calculate cost per transaction, per active customer or per GB processed, allocate shared costs, combine billing with business metrics and use the result in product decisions.
FinOps$ SELECT cost / orders AS unit_cost▍“The cloud bill went up 30% this quarter.” Is that good or bad? Without context, nobody knows. If the number of orders grew 60% over the same period, the company became more efficient. If orders stayed flat, there is waste to hunt down.
Looking only at the total bill leads to bad decisions: cuts that stall growth, or optimizations that don’t matter. Unit economics — the cost per unit of value delivered — is the metric that puts the cloud in the same conversation as revenue and margin.
Choosing the right unit
The unit should represent what the customer buys or what generates revenue. Examples:
| Type of business | Cost unit |
|---|---|
| E-commerce | Cost per completed order |
| B2B SaaS | Cost per active customer (tenant) per month |
| Fintech | Cost per processed transaction |
| Streaming | Cost per hour watched |
| Data platform | Cost per GB ingested or per query |
| AI product | Cost per conversation or per resolved task |
Good units have three characteristics: they are understood by the business, they are measured reliably (ideally daily), and they vary with infrastructure usage. “Registered users” is usually a poor choice — inactive users generate neither cost nor revenue.
The formula (and the hard part)
The math itself is simple:
unit cost = cloud cost attributed to the product / number of units in the period
The hard part is the numerator. It needs to include:
- Direct costs: resources tagged with the service (instances, databases, queues).
- Shared costs: Kubernetes cluster, networking, observability, security, provider support.
- Amortized discounts: use
EffectiveCost(effective cost), not the billed amount, so that upfront Savings Plans purchases don’t distort individual months.
Allocating shared costs
There is no perfect method; there is an agreed-upon and consistent method. The most common options:
- Proportional to usage: the cluster is split by the fraction of CPU and memory each namespace requested. Tools like OpenCost and Kubecost do this calculation.
- Proportional to direct cost: whoever spends 40% of the direct costs gets 40% of the shared ones.
- Fixed split: agreed once a year for costs that don’t vary (e.g., enterprise support).
The classic mistake is leaving shared costs out. In many companies they account for a large slice of the bill — and the “official” unit cost ends up artificially low.
Building the data pipeline
You need to bring together two sources that usually live in different worlds: billing data and business metrics.
- Export billing in a standardized format — FOCUS makes this much easier if you use more than one provider.
- Export business metrics (orders, active customers) daily from the production database or analytics tool into the same data warehouse.
- Join them by day and by product/service:
WITH daily_cost AS (
SELECT
DATE(ChargePeriodStart) AS day,
Tags['product'] AS product,
SUM(EffectiveCost) AS cost
FROM focus_billing
GROUP BY 1, 2
),
daily_orders AS (
SELECT DATE(created_at) AS day, 'checkout' AS product, COUNT(*) AS orders
FROM orders
WHERE status = 'completed'
GROUP BY 1
)
SELECT
c.day,
c.cost,
p.orders,
c.cost / NULLIF(p.orders, 0) AS cost_per_order
FROM daily_cost c
JOIN daily_orders p USING (day, product)
WHERE c.product = 'checkout'
ORDER BY c.day;
- Put the result on a dashboard with two lines: total cost and unit cost. The story is in the relationship between them.
Reading the numbers
Here is a fictional quarter:
| Month | Cloud cost | Orders | Cost per order |
|---|---|---|---|
| August | $180,000 | 1,200,000 | $0.150 |
| September | $205,000 | 1,550,000 | $0.132 |
| October | $234,000 | 1,920,000 | $0.122 |
Total cost went up 30%, but cost per order dropped 19%. This team doesn’t have a cost problem — it has a product that is growing efficiently. Now flip it around: if cost per order were rising month after month, it would be worth investigating even with a flat bill.
With unit economics, the questions move up a level:
- Pricing: a plan that costs $49/month with an infrastructure cost of $31 per customer has a gross margin that is far too thin.
- Unprofitable customers: in multi-tenant SaaS, a few customers can consume a disproportionate share of resources. Cost per tenant shows who needs a different plan or limits.
- Architecture: a refactor that reduces cost per order by $0.02 is worth $38,400 per month at 1.92 million orders — a much stronger argument than “it’ll be cheaper”.
- Forecasting: if the business projects 3 million orders, the cost projection comes from the unit cost, not from “the bill grows 10% a year”.
Unit economics per feature
Once you have the per-product view, go deeper. With per-feature tags or labels (or with distributed tracing data), you can answer:
- How much does each search cost?
- How much does it cost to generate a PDF report?
- How much does each AI assistant response cost? (see FinOps for AI and LLMs)
These answers change product decisions: usage limits on the free plan, aggressive caching for expensive features, asynchronous batch processing.
Common pitfalls
- A unit chosen by engineering, without the business. If finance and product don’t recognize the metric, it won’t make it into decisions.
- Monthly granularity. With one data point per month, it takes you a quarter to notice a trend. Calculate it daily.
- Ignoring non-production environments. Staging and development are also part of the cost of delivering the product — treat them as shared cost or as a separate line item.
- Chasing the number at any cost. A low unit cost with a poor experience is not efficiency. Track it alongside your SLOs.
Where to start
- Pick one product and one unit together with the product team and finance.
- Make sure that product’s resources have reliable tags.
- Define and document the allocation rule for shared costs.
- Build the daily query and the dashboard with total cost and unit cost.
- Present the trend at the monthly business review — not just at the infrastructure meeting.
The right question isn’t “how much do we spend on the cloud?”. It’s “how much does it cost to deliver one unit of value to the customer — and is that number getting better?”.