CloudGuild · Blog · Cheat sheets · Lessons · Certifications
Elastic Load Balancing — Traffic Distribution Options: When to Use What (and How the Exam Tests It)
Explore Elastic Load Balancing options. Learn when to choose Application, Network, or Gateway Load Balancers and how the exam tests your knowledge.
Elastic Load Balancing (ELB) is essential for distributing incoming traffic across multiple targets. This includes EC2 instances, containers, and IP addresses. The three types of ELB—Application Load Balancer (ALB), Network Load Balancer (NLB), and Gateway Load Balancer (GWLB)—each serve distinct purposes. Making the right choice can significantly impact your application’s performance and reliability.
When to Choose What
Application Load Balancer (ALB)
- Use Case: HTTP/HTTPS traffic.
- Features: Advanced routing capabilities such as path-based and host-based routing. Ideal for web applications needing Layer 7 functionalities like SSL termination.
Network Load Balancer (NLB)
- Use Case: TCP traffic.
- Features: High performance, capable of handling millions of requests per second. Supports static IP addresses. Best for latency-sensitive applications requiring Layer 4 load balancing.
Gateway Load Balancer (GWLB)
- Use Case: Transparent network services.
- Features: Integrates with third-party appliances for security and monitoring. Useful for scenarios where virtual appliances are needed in a scalable manner.
Comparison Table
| Load Balancer Type | Protocol | Use Cases | Key Features |
|---|---|---|---|
| ALB | HTTP/HTTPS | Web applications | Path-based routing, SSL termination |
| NLB | TCP | Latency-sensitive applications | Static IP, millions of requests/sec |
| GWLB | Transparent | Security and monitoring with appliances | VPC integration, scalable architecture |
Key Architectural Decisions
When selecting a load balancer, consider the following:
- Choose ALB for web applications needing Layer 7 features.
- Choose NLB for applications sensitive to latency that require Layer 4.
- Choose GWLB for integrating virtual appliances efficiently.
- Consider cross-zone load balancing for enhanced fault tolerance in both ALB and NLB.
Gotchas & Exam Traps
Understanding the differences is critical. Here are common pitfalls:
- ALB is strictly Layer 7, unsuitable for non-HTTP traffic. This is a frequent exam focus.
- NLB lacks the advanced routing features of ALB, limiting its use cases.
- GWLB requires VPC endpoints, which can introduce additional costs, a detail often tested.
- Be aware of the limits on the number of listeners and rules for ALB, as these can affect your design choices.
How the Exam Tests This
The exam will often present scenarios requiring you to choose the appropriate load balancer based on traffic type and application needs. Here are some patterns to watch for:
- Scenario Questions: You may be asked to select a load balancer type based on specific application requirements. For example, if an application needs advanced routing capabilities and SSL termination, the correct answer is ALB.
- Comparison Questions: These questions might ask you to identify the best load balancer for a scenario involving high throughput and low latency, which would lead you to choose NLB.
- Cost Considerations: Be prepared for questions that involve evaluating the costs associated with using GWLB due to its reliance on VPC endpoints.
The Rule to Remember
Choose ALB for web applications needing Layer 7 features, NLB for latency-sensitive Layer 4 applications, and GWLB for integrating virtual appliances.
For more practice, Take the free SAA-C03 mock exam.