Serverless is great — for the right use cases. And terrible for the wrong ones.
What is Serverless¶
You don’t manage servers. You pay per execution. It scales automatically from 0 to infinity.
When YES¶
- Event-driven workloads (webhooks, S3 triggers)
- Unpredictable traffic (from 0 to spike)
- APIs with low traffic
- Cron jobs
- Image/video processing
- Prototypes and MVPs
When NO¶
- Steady-state workloads (a 24/7 server is cheaper)
- Long-running processes (>15 min limit)
- WebSockets
- Latency-sensitive (cold start)
- Large monolithic applications
Cold Start¶
Lambda cold start: 100ms-5s depending on language and size. Go/Rust < Python < Node.js < Java.
Vendor Lock-in¶
Lambda/Functions API is proprietary. Solution: a framework like Serverless Framework, SST, or SAM for abstraction.
Costs¶
Free tier: 1M requests/month. But watch out for hidden costs: API Gateway, CloudWatch Logs, data transfer.
Rule¶
Serverless for event-driven, spiky, low-traffic. Containers for steady-state, complex, long-running.