Application Load Balancer (ALB)
High-performance Layer 7 routing mechanism distributing web traffic based on path rules, host headers, and SSL status.
1. System Requirements
- Perform Layer 7 routing (HTTP paths, cookies, headers, query strings).
- Handle TLS/SSL offloading (SSL termination) to offload cipher decryption from application servers.
- Establish active health checks for targets to automatically redirect traffic away from failing servers.
- High availability across multiple Availability Zones.
- Auto-scaling capacity to absorb unexpected traffic surges.
- Support HTTP/2, WebSockets, and integration with WAF security systems.
2. Scale & Resource Estimates
Throughput: Dynamically scales from 1,000 to over 5,000,000 Requests Per Second (RPS) via DNS scaling.
Storage & RAM: Zero persistent storage. Tracks active TCP connections in dynamic routing tables (RAM footprint is ~10 KB per active socket).
3. System API Endpoints
// Route Request based on URL path
GET /api/v1/users --> Target Group: user-service (Port 8080)
GET /api/v1/orders --> Target Group: order-service (Port 8081)
4. Database Schema Design
Memory tables mapping target nodes:
UserTargetGroup = ["10.0.1.12:8080", "10.0.2.44:8080"]
OrderTargetGroup = ["10.0.1.15:8081", "10.0.2.98:8081"]
5. Interactive High-Level Architecture
6. Scalability Deep Dive & Bottlenecks
ALBs operate at Layer 7 of the OSI model. When an HTTPS request arrives, the ALB terminates the SSL handshake, decrypts the request payload, inspects the headers (e.g. Host headers or Path cookies), and makes a routing decision using load balancing algorithms (Round Robin, Weighted, Least Outstanding Requests). Once a target is selected, it opens a fresh HTTP/1.1 or HTTP/2 connection to the backend node.
7. Production Scaling Strategies
DNS Round-Robin: AWS scales ALBs by expanding the list of IP addresses returned by the load balancer's domain name.
Connection Pooling: Keep-alive connections are maintained with target backends to avoid TCP handshake overhead on every client request.
Sticky Sessions: Route subsequent requests from the same user to the same target node using cookie attributes.
8. Runnable Production Starter Code
Scaffold