Lambda vs Fargate

Serverless.

Overview

Lambda versus Fargate is the choice between two AWS serverless models with very different shapes. Lambda is event-driven, sub-15-minute execution, per-millisecond billing, optimised for short-lived functions triggered by events. Fargate is container-based, long-running, per-second billing, optimised for containerised workloads that need a constant footprint or run longer than Lambda’s ceiling. The discipline is matching the workload shape to the right serverless model rather than picking based on familiarity.

The approach

The practical approach is to match Lambda to event-driven short-lived workloads (API endpoints, queue consumers, scheduled jobs under 15 minutes), Fargate to long-running containerised workloads (web servers, background workers, anything beyond Lambda’s ceiling), per-team operational preference where the workload could go either way, and per-service documented rationale committed to the infrastructure repo.

Why this compounds

Serverless discipline compounds across services. Each correct match avoids the painful migration when a Lambda hits the 15-minute ceiling or a Fargate task wastes idle compute. The team builds intuition for serverless economics that pays off on every new workload.