Serverless = FaaS + BaaS
An event invokes a stateless function; everything it must remember lives in managed services. No servers to size or patch, and idle costs nothing.
Serverless means no servers?
Bad: “There are no servers”
There are. They just stop being your problem.
Good: An operating model
Give up control of machine, runtime and scaling; get no idle cost, no capacity planning.
Same 100 ms handler. Why did this request take 800 ms?
No idle environment, so a new one runs Init first: runtime, imports, SDK clients, a DB connection. Typically under 1% of calls pay it.
30,000 requests/s × 0.1 s = 3,000 environments at 10:00. Quota raised. Serverless scales automatically, right?
The catch
Not instantly. Lambda adds 1,000 environments per 10 s: ≈ 440,000 requests get 429s while it catches up.
1,000 environments, one Postgres. Who gets a connection?
Each opens its own, against a typical max_connections of 100: 900 refused. A pooling proxy serves them from 50 real connections.
27/s
break-even against two always-on containers
A 512 MB, 100 ms function costs ≈ $1.03 per million requests. Two containers cost $72 a month, busy or idle. Above that, steady traffic favours them.
When not to use it
- Steady high load: a premium on every request
- Jobs past the 15-minute limit, like video encodes
- Heavy in-memory state: big caches, game rooms
- Chatty, data-heavy pipelines, like Prime Video’s monitor
Remember
Serverless is functions plus managed services: no idle cost, pay per request. Plan concurrency, pool connections, move steady load to containers.