What You Will Learn
Intermediate
- What a load balancer does
- The three types (ALB, NLB, CLB)
- How to set one up
A Load Balancer distributes incoming traffic across multiple EC2 instances. If one instance fails, traffic routes to the others. Improves availability and performance.
| Type | Layer | Best for |
|---|---|---|
| ALB (Application) | HTTP/HTTPS (Layer 7) | Web apps, APIs |
| NLB (Network) | TCP/UDP (Layer 4) | Low latency, gaming |
| CLB (Classic) | Legacy | Avoid (deprecated) |
ALB + ASG = the standard pattern
ALB distributes traffic to an Auto Scaling Group. ASG adds instances when load increases. ALB automatically routes to new instances. This is the standard web app pattern.Practical Exercise
Go to EC2 -> Load Balancers
Create an Application Load Balancer
Choose 2+ AZs (required for ALB)
Create a target group with 2 EC2 instances
Test by accessing the ALB DNS name
Key Takeaways
- Load Balancer distributes traffic across instances.
- ALB: HTTP/HTTPS (web apps). NLB: TCP/UDP (low latency).
- ALB + ASG = standard web app pattern.
- ALB requires 2+ AZs for high availability.
- If an instance fails, ALB routes to healthy ones.
Comments
Comments
Post a Comment