VISI

Elastic Load Balancing (ELB)

Load BalancerLayerProtocolUse Case
ALB7 (HTTP)HTTP, HTTPS, WebSocketMicroservices, containers, path/header routing
NLB4 (TCP/UDP)TCP, TLS, UDPExtreme performance, static IP, millions req/sec
GWLB3 (Network)IP PacketsThird-party network appliances (firewalls, IDS)
CLB (legacy)4 & 7HTTP, HTTPS, TCPDeprecated, avoid

ALB routing: URL path (/users, /posts), hostname, query strings, headers. Target groups can be EC2 instances, ECS tasks, Lambda functions, IP addresses.

ALB Good to Know: Fixed hostname. Client IP is in X-Forwarded-For header (EC2 won't see the real client IP directly). Supports SNI (multiple SSL certs per listener). HTTP → HTTPS redirect.

NLB Good to Know: One static IP per AZ (can assign Elastic IP). Ultra-low latency. Target groups: EC2, IP addresses, or ALB. Health checks support TCP, HTTP, HTTPS.

GWLB: Uses GENEVE protocol on port 6081. Transparent gateway + load balancer for security appliances. All traffic passes through 3rd-party virtual appliances.

Cross-Zone Load Balancing: ALB = enabled by default, no charge. NLB/GWLB = disabled by default, you pay for cross-AZ data if enabled. CLB = disabled by default, no charge if enabled.

Sticky Sessions (Session Affinity): Same client always goes to same instance. Uses cookies. ALB: application-based (AWSALBAPP) or duration-based (AWSALB) cookies. Can cause load imbalance.

Connection Draining / Deregistration Delay: Time to complete in-flight requests when deregistering. Default 300s (1-3600s). Set low for short requests.

SNI (Server Name Indication): Allows loading multiple SSL certs on one web server. ALB + NLB support it. CLB does NOT.

Health Checks: ELB sends requests to a port/path. Must return 200 OK to be considered healthy.

References

Quiz

A few quick questions based on this unit. Mark it complete when you are done.

Question 1 / 2

Which option best fits this scenario: ALB Good to Know: Fixed hostname. Client IP is in X-Forwarded-For header (EC2 won't see the real client IP directly). Supports SNI (multiple SSL certs per listener). HTTP?