InterviewHubPRO
Section Overview
Q4

Question 4 of 65

Part 1: Intro, Architecture & Well-Architected Framework (1 - 5)

6%
AWS Cloud Architecture•Part 1: Intro, Architecture & Well-Architected Framework (1 - 5)

How do you decide between deploying an application on EC2, ECS (Fargate), EKS, or serverless Lambda?

In Simple Words:

  • AWS Lambda: Best for event-driven, bursty, or unpredictable traffic (webhooks, cron jobs, file processing) where scaling down to zero saves money.
  • ECS (Fargate): Best for standard long-running containerized web APIs where you want Docker without managing EC2 servers or Kubernetes clusters.
  • Amazon EKS: Best for large enterprise microservice fleets requiring Istio service mesh, cross-cloud portability, or complex Kubernetes tooling (Helm, ArgoCD).
  • Amazon EC2: Used when legacy OS access, custom kernel drivers, high-performance computing (HPC), or specialized GPU architectures are mandatory.
yaml
# AWS SAM / CloudFormation: Serverless Lambda definition with scaling limits:
CheckoutFunction:
  Type: AWS::Serverless::Function
  Properties:
    Handler: app.handler
    Runtime: nodejs20.x
    MemorySize: 1024
    Timeout: 10
    ProvisionedConcurrencyConfig:
      ProvisionedConcurrentExecutions: 20 # Zero cold starts for checkout