Choosing the Right
AWS Compute Service

A complete architectural decision guide covering EC2, ECS, EKS, and Lambda — with trade-off analysis, real-world scenarios, and interview-ready reasoning.

Operations Overhead Cost Optimization Scaling Behavior Multi-Cloud Portability Day 2 Operations
💡
Architect's Principle: Identify the ops tax you're willing to pay versus the level of control you actually need. The best interview answers move past definitions and into patterns, trade-offs, and Day 2 operations reasoning.

Decision Flow

Answer 3 questions to reach the right service
WORKLOAD New deployment needed Event-driven or bursty traffic? YES ⚡ AWS Lambda Serverless · Pay per execution Millisecond scaling · $0 at idle NO Kubernetes or multi-cloud required? YES ⚙ Amazon EKS Kubernetes · Portable $0.10/hr cluster · Helm-compatible NO Legacy app or OS-level control needed? YES 🧱 Amazon EC2 VMs · Full OS control Best at ≥80% utilization (RI) NO 🏭 Amazon ECS — Goldilocks Choice Managed containers · No K8s overhead · No control plane fee

Service Deep Dives

Metrics, use cases & interview tips
🧱
Amazon EC2
Elastic Compute Cloud — Virtual Machines
Brick & Mortar

Best for legacy apps, specialized OS requirements, GPU workloads, or 24/7 steady-state services. Use Reserved Instances for the lowest unit cost at high utilization.

Scaling Speed
Minutes
Ops Effort
High
Cost Model
Per instance 24/7
Sweet Spot
≥80% utilization
💡 Interview Tip Mention EC2 when the app is not cloud-native or requires kernel tuning. Reference Reserved Instances for 24/7 steady workloads — lowest unit cost. Lead with "Day 2 Ops" cost of patching.
🏭
Amazon ECS
Elastic Container Service — AWS-Native Containers
Efficient Factory

AWS-native container orchestration without Kubernetes overhead. Pairs with Fargate to eliminate all server management. No control plane fee unlike EKS. Ideal for standard REST microservices.

Scaling Speed
Seconds
Ops Effort
Low / Medium
Control Plane
Free
Cold Starts
None
💡 Interview Tip Frame as the "Goldilocks" solution. Better than Lambda for steady workloads (no cold starts), simpler than EKS for AWS-only teams (no K8s tax). Mention Fargate to eliminate EC2 patching.
⚙️
Amazon EKS
Elastic Kubernetes Service — Managed Kubernetes
Universal OS

For enterprise systems with hybrid-cloud or heavy Kubernetes ecosystem investment. Use identical Helm charts, Prometheus setups, and manifests across on-prem and cloud. Maximum portability.

Scaling Speed
Seconds
Ops Effort
High
Control Plane
$0.10/hr
Multi-Cloud
Yes ✓
💡 Interview Tip Lead with portability. If the company needs to avoid cloud lock-in or runs Helm/Prometheus on-prem, EKS is the only choice. Frame $0.10/hr as an investment in a universal Kubernetes API.
AWS Lambda
Serverless Functions — Event-Driven Compute
Electric Switch

Purpose-built for event-driven tasks — S3 uploads, DynamoDB streams, API glue code. Scales to thousands of concurrent executions in milliseconds. Zero cost at zero traffic.

Scaling Speed
Milliseconds
Ops Effort
Minimal
Max Duration
15 minutes
Idle Cost
$0.00
💡 Interview Tip "If nobody uses it at 3 AM, you pay $0." Always add the counter: at high constant volume, Lambda becomes significantly more expensive than EC2/ECS — demonstrating this earns respect.

Trade-off Matrix

Side-by-side across key architectural dimensions
Dimension 🧱 EC2 🏭 ECS ⚙ EKS ⚡ Lambda
Abstraction Level Virtual Machines Containers (Opinionated) Containers (Kubernetes) Functions (Serverless)
Scaling Speed Minutes (ASG boot) Seconds (fast) Seconds (complex) Milliseconds Fastest
Cost Model Per instance, 24/7 Per resource (EC2/Fargate) $0.10/hr + resources Per execution/duration
Best Traffic Steady 24/7 (≥80% util) Steady or variable Large-scale, mixed Bursty / unpredictable Cheapest
Ops Effort High — OS, patching, ASG Low / Medium High — K8s complexity Minimal — no infra Lowest
Multi-Cloud No AWS-only Yes — K8s API everywhere Only Option No
Cold Starts N/A None None Yes (mitigated via Provisioned Concurrency)
Control Plane Fee None Free Advantage $0.10/hr (~$72/mo) None

Real-World Scenarios

Interview-ready architectural reasoning
Scenario 01⚡ AWS Lambda
Event-Driven Image Processor
The Problem
Social media app: users upload profile pictures that need resizing and S3 storage on every upload.
"Lambda because the workload is event-driven and bursty. Zero traffic at 2 AM = $0. If 10,000 photos hit at once, Lambda scales horizontally in milliseconds. Running EC2 to wait for uploads wastes capital."
Scenario 02🏭 ECS + Fargate
High-Traffic E-Commerce API
The Problem
Standard REST API for retail. Needs reliability, thousands of req/sec, and fast CI/CD deploy cycles.
"ECS is the Goldilocks solution. No cold starts like Lambda, no K8s control plane to manage like EKS. Best balance for AWS-native teams who want to focus on code, not infrastructure."
Scenario 03⚙️ Amazon EKS
Enterprise Multi-Cloud Platform
The Problem
Financial institution running on-prem and AWS, requiring identical deployment tooling across both environments.
"EKS for portability. Already using Helm charts and Prometheus on-prem, so EKS lets us use the same manifests. It's an investment in a universal API — worth the $0.10/hr control plane cost."
Scenario 04🧱 Amazon EC2
Legacy Monolith / Self-Managed DB
The Problem
Legacy Java app requiring 128GB RAM and specific kernel tuning, or a self-managed Cassandra cluster.
"EC2 when full OS control is required and containerizing is too costly. For 24/7 steady-state, Reserved Instances deliver the absolute lowest unit cost per hour — no alternative beats that."

Interview Quick Reference

Six answers to close the interview strong
Cost for low or variable traffic?
Lambda wins — pay per request only.
Cost for high steady-state workloads?
EC2 or ECS — lower consistent hourly rate.
Fastest scaling speed?
Lambda (ms) › ECS (sec) › EC2 (min)
Lowest operational effort?
Lambda < ECS < EKS — zero to high.
ECS vs EKS — quick decision?
ECS = AWS-native; EKS = K8s portability.
Lambda vs Containers?
<15 min event-driven → Lambda. Long-running / WebSockets → Containers.