Serverless FaaS Economics Lab (Interactive)
Sweep traffic shape and duration until the Lambda-versus-EKS cost curves cross, then defuse the connection storm. Bursty events make FaaS unbeatable; sustained high QPS makes it 3-6× provisioned cost. Cold starts, provisioned concurrency, and RDS Proxy pooling complete the picture.
Serverless TCO & Cold Start
Flash-sale webhook: $0 at idle, thousands of containers at peak. Find the crossover where EKS beats Lambda.
Monthly TCO crossover
Peak conns
116
Cold share
45%
p99 latency
560 ms
Spike shape (8× burst, mostly idle): Lambda wins by 1.7× — scale-to-zero means the trough costs $0.00 while the EKS fleet sized for 116 concurrent handlers idles at your expense. Coca-Cola vending-machine telemetry: same economics, −65% compute cost.
RDS Proxy holds 50 warm connections and multiplexes every burst — the classic fix for ephemeral runtimes (Lambda/PHP) slamming process-per-connection databases.
Hard platform limits to name in interviews: 15-minute max execution (0 s handler fits comfortably), stateless containers (no sticky WebSocket sockets), and cold-start p99 tax of $280 ms per fresh Node / Python environment.
How It Works Under the Hood
FaaS bills per request and per GB-millisecond and scales from zero, which is perfect economics for flash-sale spikes and nightly jobs, and ruinous for a steady 24/7 firehose where provisioned containers cost 3-6× less. The operational edges are equally sharp: cold starts add 100 ms to 3 s depending on runtime — Go boots in about 120 ms, JVM/Spring closer to 3 s — and mitigations like provisioned concurrency reintroduce a fixed cost. Auto-scaling thousands of concurrent containers also opens thousands of database TCP connections unless an RDS Proxy multiplexes them onto a small warm pool.
Core Architectural Principles
- Cost model: request count plus GB-seconds versus provisioned pods sized by peak concurrency from Little's Law.
- Burst shape drives the crossover — idle troughs are free on Lambda but idle paid pods on EKS.
- RDS Proxy toggle caps backend connections while direct mode crashes past Postgres max_connections at peak.
Choose FaaS by traffic shape, not fashion: spiky, event-driven, and sub-15-minute workloads fit; steady-state high-QPS, sub-5 ms p99, or long-running compute does not. Always pair Lambda+RDS with a proxy to survive autoscaling connection storms, and quantify cold starts by runtime before proposing provisioned concurrency for latency-sensitive paths.
Zero-ops scale-to-zero economics versus cold-start latency, 15-minute limits, and per-ms premium under sustained load.