AWS Lambda + API Gateway
Pay-per-invocation HTTP APIs. Wins on cost when traffic is spiky and on idle time. SnapStart drops cold starts to single-digit ms for Java and Python.
- Compare: EC2 vs Lambda
- Compare: Lambda vs ECS Fargate
Compute decision tree
Stop debating Lambda vs ECS vs EKS in design reviews. Walk the tree, get an opinionated answer, and link straight to the comparison guides.
Last updated: April 30, 2026 Author: FactualMinds AWS Architects Reviewed by: AWS Solutions Architect — Professional certified
Pick the closest match. Long-running services, async jobs, and full Kubernetes ecosystems each have a clear best fit.
This tree captures the trade-offs we make in real architecture reviews. The goal is not to be exhaustive — it is to get you to a defensible default in 60 seconds. If two answers feel close, walk both branches and read the comparison guides at each leaf; the right call usually becomes obvious.
If you do not see your scenario, the most common hybrid is Lambda for spiky API traffic + Fargate for steady services + Batch for long-running async work. That is a healthy production shape.
Reference list of every endpoint in this decision tree — useful when you want to skim before answering questions, or when JavaScript is disabled.
Pay-per-invocation HTTP APIs. Wins on cost when traffic is spiky and on idle time. SnapStart drops cold starts to single-digit ms for Java and Python.
Serverless workers triggered by SQS, EventBridge, S3 events, DynamoDB streams, or API Gateway. Default async compute when jobs finish in < 15 min.
AWS-native container orchestration without owning the cluster. The lowest-friction container path on AWS — perfect for steady production services.
Run a long-running container on demand. Right answer for jobs that exceed 15 minutes but are still bursty enough that you do not want to keep instances warm.
Container orchestration with EC2-level instance control. Pick this when you need GPUs, custom AMIs, or reserved-instance pricing that Fargate cannot offer.
Managed Kubernetes. EKS Auto Mode (GA Dec 2024) removes most cluster ops. Pick this when you need the Kubernetes ecosystem — Helm, operators, multi-tenancy, CRDs.
The "git push and forget" path. Push a container or source repo, App Runner builds, deploys, scales, and serves it. Good for early product, internal tools, and low-volume APIs.
Flat-rate VMs with predictable monthly pricing. Good for WordPress, simple back-ends, and dev environments where billing transparency matters more than scale.
Static site + CDN with optional Lambda functions and pre-built integrations. Default for Next.js, Astro, Nuxt, SvelteKit front-ends.
Managed batch scheduling on Fargate or EC2. Handles job queues, retries, dependencies, and instance scaling for embarrassingly parallel CPU work.
For ML training, SageMaker Training gives you the highest-level abstraction. For arbitrary GPU batch (HPC, simulation, custom CUDA), Batch + EC2 GPU instances is right.
ECS Fargate is the lowest-friction container path on AWS. You get container deployment, autoscaling, IAM-integrated networking, and CloudWatch logging without ever touching nodes or kubelets. EKS is more powerful but pays back its complexity only when you actually need the Kubernetes ecosystem (Helm, operators, CRDs, multi-tenancy patterns).
Lambda wins on spiky traffic and on jobs that finish under 15 minutes. It loses on steady high-throughput services where Fargate or EC2 is materially cheaper, and it is awkward for long-lived connections like WebSockets. The decision tree captures these breakpoints.
EKS Auto Mode (GA Dec 2024) removes most node ops — networking, storage, and Karpenter-style autoscaling are managed by AWS. If you already chose EKS, Auto Mode is the easier path. It does not change the EKS-vs-ECS decision; it just lowers the operational tax of being on EKS.
Send us your workload requirements and we'll write back with a one-page architecture recommendation — usually within two business days.
We use cookies and similar technologies to analyze site traffic, personalize content, and provide social media features. By clicking "Accept," you consent to our use of cookies. You can adjust your preferences at any time.