How it works
You upload code. When an HTTP request or event (S3 upload, queue message) arrives, the provider spins up a container with your function, executes it, and shuts it down. A "cold start" — the first invocation after idle time — can add latency (tens of ms to seconds).
When it fits
- Irregular load: from zero to peak traffic
- Event-driven tasks: file processing, webhooks, DB triggers
- MVPs and prototypes — no server setup needed
When it does not fit
- Long-running processes (15-min execution limit in AWS Lambda)
- Steady traffic — more expensive than a traditional server
- Stateful applications with persistent connections (WebSocket)