Serverless computing promised to eliminate infrastructure concerns entirely. Developers write functions; the cloud provider handles provisioning, scaling, patching, and availability. For many workloads, it delivers on that promise spectacularly. For others, it introduces a new class of problems that trade operational complexity for architectural constraints.
Where Serverless Excels
The economic case for serverless is compelling for workloads with highly variable or unpredictable traffic. A function that processes uploaded images scales from 0 to 10,000 concurrent executions automatically — you pay for exactly the compute consumed. A container that must be always-on to avoid cold starts costs money 24/7, even at 3 AM when traffic is zero. For event-driven background processing, webhooks, and async jobs, serverless is almost always the right choice.
- Ideal workloads: Image/video processing, email sending, PDF generation, scheduled jobs, webhook consumers, API backends with spiky traffic.
- Poor fits: Long-running processes (over 15 minutes), WebSocket servers, workloads requiring persistent in-memory state, high-frequency low-latency APIs where cold starts are unacceptable.
The Cold Start Reality
Cold starts remain serverless' most discussed limitation. When a function hasn't been invoked recently, the provider must initialise a new execution environment — downloading the function code, starting the runtime, executing initialisation code. For Python and Node.js, this is typically 200–500ms. For Java and .NET, it can exceed 2 seconds. For user-facing API routes where p99 latency matters, cold starts require mitigation: provisioned concurrency (which partially negates the cost savings), edge runtimes like Cloudflare Workers (near-zero cold starts), or architectural patterns that keep warm instances alive via periodic pings.
Cost: Not Always Cheaper at Scale
The "pay per invocation" model is transformatively cheap at low volumes and becomes surprisingly expensive at high, consistent volumes. At roughly 1–5 million requests per month (depending on function duration), a dedicated container becomes more cost-effective than Lambda. Run the maths for your specific workload before assuming serverless is the cheaper option at production scale. The operational savings in reduced infrastructure management effort are real but must be weighed against the per-invocation cost at volume.