AWS Lambda vs. ECS Fargate: An honest cost breakdown at 100M monthly requests
The serverless promise is seductive: zero server maintenance, auto-scaling from zero to infinity, pay only for what you compute. And for low-volume or bursty workloads, AWS Lambda is almost free. But when a SaaS client scaled to 100 million API requests per month, their AWS bill hit $4,800/month for Lambda and API Gateway alone.
The hidden costs of serverless at scale
People think compute duration is the main cost of Lambda. In reality, the auxiliary services bite harder:
- API Gateway charges $3.50 per million requests. At 100M requests, that is $350 just for routing. - NAT Gateway data processing charges for Lambdas inside private VPCs communicating with RDS. - Provisioned Concurrency required to eliminate 800ms cold starts on database-connected Lambdas during peak hours.
The ECS Fargate migration
We containerized the Node.js API with a minimal Alpine Docker image and deployed it across three availability zones using Amazon ECS Fargate behind an Application Load Balancer (ALB):
- Four 0.5 vCPU / 1GB RAM Fargate tasks running continuously - Auto-scaling based on target request count per target - Zero cold starts because tasks stay warm - Shared persistent connection pooling to RDS PostgreSQL, eliminating database connection churn
Financial breakdown
The numbers after the migration:
- Previous Serverless Stack: $4,820 / month - ECS Fargate + ALB Stack: $1,890 / month - Monthly Savings: $2,930 (61% reduction) - P99 latency dropped from 720ms to 95ms due to warm connections and zero cold starts.
Serverless is unbeatable for MVPs, scheduled cron tasks, and unpredictable spikes. But once steady baselines exceed 20M requests, containers almost always win on cost and latency.
Have a similar challenge?
We build production-grade software for companies that need it done right.
Let's Talk
