On this page
ELB (Elastic Load Balancing)
Elastic Load Balancing is AWS's managed load balancer. It sits in front of a group of targets โ EC2 instances, containers, IPs, or Lambda functions โ and spreads incoming traffic across the healthy ones. If a target fails its health check, the load balancer stops sending it traffic; if you add more targets, they automatically start receiving their share.
Why a Load Balancer
A single server is both a bottleneck and a single point of failure. Put several servers behind a load balancer and you get two things at once:
- Scalability โ traffic is distributed across many targets, and you can add or remove targets without clients noticing.
- High availability โ the load balancer continuously health-checks targets and routes around unhealthy ones, and it spans multiple Availability Zones.
Clients only ever talk to one stable endpoint (the load balancer's DNS name); the fleet behind it can change freely.
The Four Types
AWS has four load balancers, distinguished mainly by which network layer they operate at:
| Type | Layer | Routes on | Use it for |
|---|---|---|---|
| ALB (Application) | 7 (HTTP) | Path, host, headers | Web apps, microservices, blue/green |
| NLB (Network) | 4 (TCP/UDP) | Port | Extreme performance, static IPs |
| GWLB (Gateway) | 3 | All traffic | Inline security appliances (firewalls) |
| CLB (Classic) | 4/7 | Legacy | Old accounts only โ usually the wrong answer |
For DOP-C02, the ALB is by far the most important โ it's the machinery behind blue/green deployments, canary releases, and Auto Scaling health checks.
The Piece That Matters Most: Target Groups
Everything plugs into a target group โ a set of targets plus a health check. An ALB has one or more listeners (e.g. HTTPS on 443), and each listener has rules that route requests to different target groups based on the URL path or host. Two ideas that flow from this shape:
- Blue/green = two target groups. You deploy the new version behind a second target group, then flip the listener from the old group to the new one.
- Auto Scaling attaches to a target group, so scaling out/in automatically registers and deregisters targets.