Serverless Vs Container Cost Tradeoff — AWS Developer (DVA-C02)
Lambda vs Fargate at High Memory and Long Duration
The reflex on a 'serverless' framing is that Lambda always costs less than Fargate. At high memory and long duration, the math flips. Lambda CPU allocation scales linearly with memory, so a function at 10 GB memory running for 90 seconds accumulates 900 GB-seconds per invocation at Lambda's per-GB-second rate. An equivalently sized Fargate task billed per second of running vCPU and memory can come in below that at sustained throughput. The crossover depends on invocation frequency, memory setting, and task duration, and where that crossover occurs is what the question is testing.
What This Pattern Tests
The exam presents a workload and asks you to choose between Lambda/API Gateway and ECS/Fargate or EKS. Lambda charges per invocation ($0.20/1M) plus duration ($0.0000166667/GB-second). Fargate charges per vCPU-hour ($0.04048) and GB-hour ($0.004445). At low, bursty traffic (< ~500K requests/day), Lambda wins because you pay nothing at idle. At steady high traffic (> ~1M requests/day), Fargate wins because the per-invocation overhead exceeds fixed compute cost. The crossover point depends on function duration and memory — the exam expects you to reason about it, not memorize a number.
Decision Axis
Traffic pattern determines compute model: bursty and unpredictable favors Lambda (zero idle cost), steady-state favors Fargate/ECS (lower per-request cost at volume).
Associated Traps
More Top Traps on This Exam
Decision Rules
Whether lambda-execution-duration-limit is satisfied and per-invocation billing eliminates idle cost, making Lambda strictly cheaper and operationally simpler than always-on or over-reserved Fargate tasks for a short-duration, bursty, event-driven workload.
Whether Lambda's per-invocation pricing model eliminates economically irrational always-on container capacity given that individual job durations are well below the Lambda execution ceiling and weekend utilization approaches zero.
Whether the workload's bursty event-driven shape and the team's zero container expertise together disqualify Fargate and EC2 Auto Scaling in favour of Lambda, where idle cost is eliminated by the pay-per-invocation model and cluster management disappears entirely.
Domain Coverage
Difficulty Breakdown