CloudGuild · Blog · Cheat sheets · Lessons · Certifications
Elastic Load Balancing — Traffic Distribution Options
Elastic Load Balancing distributes incoming application or network traffic across multiple targets to ensure high availability and fault tolerance.
What it is
- Elastic Load Balancing (ELB) automatically distributes incoming application or network traffic across multiple targets (EC2 instances, containers, IP addresses).
- Three types: Application Load Balancer (ALB), Network Load Balancer (NLB), Gateway Load Balancer (GWLB).
When I reach for it
- ALB: Use for HTTP/HTTPS traffic, provides advanced routing (path-based, host-based).
- NLB: Use for TCP traffic, high performance, handles millions of requests per second, and supports static IP.
- GWLB: Use for transparent network services, integrates with third-party appliances for security and monitoring.
Key architectural decisions
- Choose ALB for web applications needing Layer 7 functionalities (e.g., SSL termination).
- Choose NLB for latency-sensitive applications requiring Layer 4 load balancing.
- Choose GWLB for integrating virtual appliances in a scalable manner.
- Consider cross-zone load balancing for both ALB and NLB to improve fault tolerance.
Gotchas & exam traps
- Remember that ALB is Layer 7 and is not suitable for non-HTTP traffic.
- NLB does not provide advanced routing features that ALB offers.
- GWLB requires VPC endpoints and can introduce additional costs.
- Be cautious of limits on the number of listeners and rules for ALB.
The architect view
- Evaluate traffic patterns and application architecture to select the right load balancer type.
- Ensure high availability by utilizing multiple availability zones.
- Monitor performance and adjust scaling policies to optimize cost and performance.