Application Load Balancer (ALB) in AWS

What is an Application Load Balancer (ALB)?

An Application Load Balancer (ALB) is a Layer 7 (HTTP/HTTPS) load balancer that intelligently routes traffic based on request details. Unlike a Classic Load Balancer (CLB), which operates at multiple layers, ALB is optimized for web applications and microservices.

Key Features of ALB

  1. Routes traffic to multiple applications on the same EC2 instance.
  2. Uses Target Groups to organize backend resources.
  3. Supports HTTP/2 and WebSockets for modern web applications.
  4. Automatic redirection from HTTP to HTTPS.
  5. Advanced Routing Options:

Why Use ALB?

ALB is ideal for microservices and containerized applications because it allows traffic distribution to multiple backends, even if they are running on the same EC2 instance (via dynamic port mapping in Amazon ECS).

Comparison with Classic Load Balancer (CLB)

Feature ALB CLB
Layer Layer 7 (HTTP/HTTPS) Layer 4 & 7 (TCP, HTTP, HTTPS)
Path-Based Routing
Host-Based Routing
WebSockets & HTTP/2
Multi-App Support (1 Load Balancer) ❌ (1 per app)
AWS Service Integrations ✅ (ECS, Lambda, IP targets) Limited

How ALB Works

1. Traffic Flow

2. Target Groups