☁︎SAA-C03

ELB

ELB — Concept

What it is

Elastic Load Balancing (ELB) = managed load balancers that distribute traffic across multiple targets (EC2, ECS tasks, IPs, Lambda) across multiple AZs. Three flavors live on the exam: ALB, NLB, GWLB. (Classic Load Balancer / CLB is legacy.)

Why it exists

Single instance = single point of failure. ELB provides HA, scaling, TLS termination, health checks, and integrates with Auto Scaling, ECS, and WAF.

Types compared (must memorize)

ALB (Application LB)NLB (Network LB)GWLB (Gateway LB)CLB (Classic)
OSIL7 (HTTP/HTTPS/WebSocket/gRPC)L4 (TCP/UDP/TLS)L3/L4 (IP packets)L4 + basic L7
Latency~mssub-ms, ultra-lowlowhigher
TargetsEC2, IP, Lambda, ECSEC2, IP, ALBAppliances (FW/IDS) via GENEVEEC2
Static IP / Elastic IPNo (DNS only)Yes (1 EIP per AZ)NoNo
Routing rulesHost-, path-, header-, query-, source-IP, method-basedPort + protocolForward-through (insert appliance)Round-robin, sticky
UseWeb apps, microservices, gRPC, HTTP/2Extreme perf, TCP/UDP, static IP, IP whitelistInline 3rd-party security appliancesLegacy, don't pick

Listeners, target groups, rules

  • Listener = port + protocol on the LB.
  • Target group = set of targets (EC2, IP, Lambda) with health check + protocol.
  • Rules (ALB) route based on host header, path, headers, query strings, source IP, HTTP method, weighted target groups.

Health checks

  • ALB: HTTP/HTTPS check, configurable path, thresholds.
  • NLB: TCP probe (or HTTP).
  • Unhealthy targets stop receiving traffic.

Cross-zone load balancing

  • ALB: enabled by default, no extra cost.
  • NLB: disabled by default, $$ for cross-zone data.
  • Important for the exam: a hot AZ can imbalance NLB if cross-zone is off.

TLS / certificates

  • ACM-issued certs attached to listener.
  • SNI supported for multiple certs on one listener.
  • ALB: HTTPS to LB, then HTTP or HTTPS to target (end-to-end TLS).
  • NLB: TLS listeners (TLS termination) or pass-through TCP.

Connections & sticky sessions

  • Sticky sessions (ALB / CLB): cookie-based; for stateful apps before you make them stateless.
  • ALB also supports application-controlled cookies.
  • Connection draining / Deregistration delay lets in-flight requests finish before target leaves.

Integrations

  • Auto Scaling Group → register/deregister automatically.
  • AWS WAF → attach WebACL to ALB.
  • API Gateway VPC Link → uses NLB.
  • ECS service → registers targets dynamically.

When to use vs alternatives

NeedUse
HTTP/HTTPS, microservices, host/path routingALB
Ultra-low latency / TCP / UDP / static IPsNLB
Inline FW / IDS / IPS chainGWLB
Global, multi-region anycast IPsGlobal Accelerator + ALB/NLB
HTTP cachingCloudFront in front of ALB

Common exam scenarios

  1. "Path-based routing /api → service A, /web → service B"ALB with rules.
  2. "Need a static IP per AZ for partner whitelisting"NLB with EIP per AZ.
  3. "Microservice routes on hostname (api.example.com vs web.example.com)"ALB host-based.
  4. "Insert 3rd-party firewall transparently for VPC traffic"GWLB + appliance fleet.
  5. "Lambda must be the target for HTTP requests"ALB → Lambda target.
  6. "Reduce cross-AZ traffic charges on NLB" → enable / weigh cross-zone carefully (it costs $).
  7. "Web app with WAF + caching + multi-region" → CloudFront + WAF in front of ALB(s), Route 53 latency.

Exam tip

  • L7 routing keywords (host, path, header) → ALB.
  • TCP / UDP / static IPNLB.
  • Firewall appliance insertionGWLB.
  • Global low-latency UDPGlobal Accelerator, not ELB.

References