Lesson 20 / 30
Unit Economics: Cost per User and per Request
Compute cost per request, per user and per 1,000 actions, and judge whether a feature is affordable.
By Rahul Agarwal · 15 years in web development
Divide the bill by something meaningful
A monthly total of a few lakh rupees means little on its own. Unit economics divides cost by a business unit: cost per 1,000 requests, cost per monthly active user, cost per order or cost per GB served. These numbers let you compare designs and check viability. If each user generates a small amount of revenue per month but costs more than that to serve, growth makes the business worse, not better. Unit costs also reveal which feature is expensive: a video feature might dominate cost per user even if few people use it. Watch for fixed versus variable cost: a database cluster costs roughly the same at 10% or 60% load (fixed until you resize), while egress and serverless invocations scale almost linearly with use (variable). At small scale fixed costs dominate the per-user number; at large scale variable costs dominate.
Cost per user and per 1,000 requests
All rates below are made-up placeholders for practice; always take real rates from your provider's current pricing page.
monthly_cost_usd = 44_000
mau = 8_000_000
requests_per_month = 2_000 * 86_400 * 30 # 2,000 avg QPS
per_user = monthly_cost_usd / mau
per_1k_req = monthly_cost_usd / (requests_per_month / 1_000)
print(f"cost per MAU : ${per_user:.4f}")
print(f"cost per 1,000 requests: ${per_1k_req:.4f}")
Output:
cost per MAU : $0.0055 cost per 1,000 requests: $0.0085
Cost per plate at a canteen
A college canteen does not just track its monthly gas and salary bill. It asks what one thali costs to make, then compares that with the selling price. Cost per request is the cost per plate of a software system.
Report units, not just totals
When you present an estimate, include at least one unit cost. 'This adds about X per thousand orders' helps product managers decide; a bare monthly total does not.
Quick check: A database cluster costs the same whether it runs at 20% or 60% load. What kind of cost is that?
- Variable cost
- Egress cost
- Marginal cost per request
- Fixed (step) cost
Answer
Fixed (step) cost — Provisioned capacity is paid for whether or not it is used, so it behaves as a fixed cost until you resize to a different step.