Serverless Cost: When It Wins, When It Doesn’t
Serverless economics are uniquely shaped. The threshold is well-defined but rarely calculated.
Serverless cost shape
Serverless economics have a specific shape: high per-request cost, zero idle cost. The crossover with provisioned compute is at a measurable request rate.
- Per-request cost. High compared to provisioned compute; the bill scales with traffic linearly.
- Scaled-to-zero. No idle cost; the killer feature for sporadic workloads.
- Crossover. Per-service crossover with provisioned at a specific request rate; below it, serverless is unbeatable.
- Above crossover. Provisioned wins; sustained traffic does not benefit from scale-to-zero.
Four thresholds
- Lambda crossover: ~10M requests/month for typical compute.
- Fargate crossover: ~24/7 utilization at 70%+.
- API Gateway crossover: ~50M req/month vs ALB.
- DynamoDB on-demand crossover: ~50K writes/day.
Migration patterns
When serverless stops paying, migration to provisioned is the answer. The mechanics depend on whether the workload is stateless or stateful.
- Stateless migration. Lambda to ECS/EKS/EC2 is mechanical; same code, different runtime.
- Stateful migration. DynamoDB on-demand to provisioned: capacity planning becomes the new problem.
- Connection model. Serverless connections are short-lived; provisioned can hold pools; the app may need adjustment.
- Cutover plan. Run both in parallel during cutover; flip traffic gradually; rollback is one DNS change.
Hybrid posture
Most mature orgs run a hybrid. Serverless for the sporadic, provisioned for the sustained; the realistic posture, not a religious one.
- Serverless for sporadic. Cron jobs, infrequent APIs, async background work; scale-to-zero pays.
- Provisioned for sustained. High-volume APIs, long-running workers; provisioned cost dominates serverless premium.
- Per-service decision. Each service picks based on traffic profile; do not force one runtime org-wide.
- Threshold tracking. Quarterly review of crossover; services migrate as their traffic profile shifts.
Antipatterns
- Serverless forever despite high volume. 3-5x bill premium.
- Provisioned for sporadic. Pay for idle.
- No threshold tracking. Crossover passes silently.
What to do this week
Three moves. (1) Apply this lever to your highest-spend workload. (2) Measure the dollar impact for one month. (3) Roll the practice out to the next two services if the savings hold.