Crisp answer: EC2 gives you VMs you manage fully. ECS manages containers using AWS's own orchestrator. EKS manages containers using Kubernetes. Lambda runs functions without any server management. The choice is a tradeoff between control and operational overhead.
EC2:
- Virtual machines you provision, patch, and manage
- Full control: OS, networking, storage, installed software
- Pricing: per-hour or per-second, On-Demand / Reserved / Spot
- Use when: you need full OS access, stateful workloads, legacy apps,
specific hardware (GPU, high memory), or maximum control
ECS (Elastic Container Service):
- AWS-native container orchestrator
- Two modes:
EC2 launch type: you manage the underlying EC2 instances
Fargate launch type: serverless — AWS manages the compute
- Simpler than EKS, tightly integrated with ALB, CloudWatch, IAM
- No control plane cost (ECS is free, you pay for the compute)
- Use when: you want containers without Kubernetes complexity,
already deep in the AWS ecosystem, or serverless containers via Fargate
EKS (Elastic Kubernetes Service):
- Managed Kubernetes control plane (API server, etcd, controllers)
- You manage: worker nodes (EC2 node groups or Fargate), add-ons,
cluster version upgrades, IAM, networking
- Control plane cost: $0.10/hr per cluster (~£75/month)
- Use when: you need Kubernetes specifically (existing workloads, team
knowledge, multi-cloud portability, ecosystem tools like Helm/Argo)
Lambda:
- Serverless function execution — no infrastructure to manage
- Triggered by events: API Gateway, S3, SQS, DynamoDB Streams, etc.
- Pricing: per request + duration (free tier: 1M requests/month)
- Limits: 15 minute max timeout, 10GB max memory, 512MB-10GB ephemeral storage
- Cold starts: first invocation after idle period takes longer to start
- Use when: event-driven workloads, infrequent tasks, glue code,
simple APIs, ingestion pipelines
Decision framework:
Need full OS control? → EC2
Containers, simple, AWS-native? → ECS (Fargate for serverless containers)
Containers, Kubernetes required? → EKS
Event-driven, short tasks? → Lambda
Stateful long-running workloads? → EC2 or EKS with StatefulSets
Batch/ML workloads? → EC2 (GPU), Batch, or SageMaker
What to say in the interview:
"The tradeoff is control vs operational overhead. EC2 is full control but you manage everything. Lambda is zero servers but constrained to 15 minutes and stateless. ECS is the middle ground for containers without Kubernetes complexity — Fargate makes it fully serverless. EKS is for when you specifically need Kubernetes: existing workloads, team expertise, or the ecosystem around Helm and GitOps. Mimecast uses EKS so the answer there is clear — they've standardised on Kubernetes for containerised services."