Skill 24 · Architect For Startups
Subchapter 24.19
references/lambda.mdMarkdown4 KBView on GitHub
Pre-seed to Series A: Lambda should be your default compute unless you have a reason not to use it.
The inflection point: Lambda becomes expensive relative to containers at ~$300-500/month in Lambda spend with predictable, sustained traffic. At that point, a single Fargate task running 24/7 is cheaper.
Provisioned Concurrency before you need it: Costs ~$15/month per provisioned instance even with zero traffic. Don’t enable until you have latency SLAs requiring <100ms p99 cold starts AND paying customers who need them.
Memory over-allocation: Startups often set 1024MB “to be safe.” At low traffic this barely matters, but at scale the difference between 256MB and 1024MB is 4x cost. Benchmark with AWS Lambda Power Tuning (opens in a new tab) once you have real traffic.
Step Functions standard workflows for high-volume: Standard Workflows cost $25 per million state transitions. If you’re processing events at volume, Express Workflows cost $1 per million (but max 5-min duration). Most startups should start with Standard and switch to Express when the bill surprises them.
VPC-attached Lambda + NAT Gateway: A NAT Gateway costs $32/month + data processing fees — often more than the Lambda itself for early startups. Use VPC endpoints ($7/month each) for S3 and DynamoDB, or keep Lambda outside the VPC entirely until you need private resource access.
Monolith Lambda is fine at your stage. The “anti-pattern” of one Lambda handling multiple routes via API Gateway is actually optimal for a 1-3 person team. Split functions when: (a) you have different scaling/memory needs per route, or (b) cold starts on a bloated package exceed your latency budget. Don’t prematurely decompose.
Skip Powertools until you have production traffic. Structured logging and tracing matter when debugging distributed systems at scale. At pre-product-market-fit, console.log and CloudWatch Logs Insights are sufficient. Add Powertools when you have >5 Lambda functions in production.
Python or Node.js, period. Unless your team is exclusively Java/Go developers, the startup hiring pool and example ecosystem for Lambda skews heavily Python/Node. Pick one and standardize. Language choice is a one-way door at the team level.
| Signal | What to Do |
|---|---|
| Monthly Lambda bill > $500 with predictable traffic | Evaluate ECS Fargate — likely 40-60% cheaper |
| P99 latency >2s due to cold starts on critical path | Add Provisioned Concurrency OR move to containers |
| Functions exceeding 15-min timeout | Move to ECS tasks or Step Functions |
| Team spending >20% of time on Lambda packaging/deployment issues | Consider containers for developer experience |
| Need WebSockets, long-lived connections, or >6MB response bodies | Lambda is architecturally wrong — use containers |
20% cheaper, often faster. No config change needed for Python/Node.js. Set arm64 on every function from day one. The only reason not to: native binary dependencies compiled for x86 (rare for startups).