Definition – Application Load Balancer (ALB)
An Application Load Balancer (ALB) is a type of load balancing technology specifically designed to manage HTTP and HTTPS traffic, routing requests to target back-end services based on content. Unlike traditional load balancers, which operate at the transport layer (Layer 4 in the OSI model) and distribute traffic based purely on network information, Application Load Balancers operate at the application layer (Layer 7 in the OSI model) and make routing decisions based on the content of the request.

Key Features of Application Load Balancer (ALB)
- Content-Based Routing: ALBs can route traffic based on URL path, hostname, HTTP headers, HTTP method, and query parameters. This allows for more granular traffic management, such as directing all requests for a specific part of an application (like images or videos) to servers optimized for that content.
- Host and Path-Based Routing: This feature enables the load balancer to route requests to different back-end services based on the domain name and URL path. For example, requests for http://sanchitgurukul.com/video might be routed to one set of servers, while http://sanchitgurukul.com/images might go to another.
- SSL/TLS Termination: ALBs handle SSL termination at the load balancer level, offloading this task from the back-end servers. This reduces the computational load on the servers and simplifies the SSL certificate management.
- WebSocket and HTTP/2 Traffic Support: ALBs natively support WebSocket and HTTP/2 protocols, allowing for full-duplex communication channels over a single TCP connection, which is particularly useful for real-time applications.
- Health Checks: ALBs continually check the health of resources that they direct traffic to, ensuring traffic is only routed to healthy servers.
- Integration with Cloud Services: In cloud environments like AWS, ALBs are deeply integrated with other services such as Amazon EC2, ECS (Elastic Container Service), and Auto Scaling. They can automatically register and deregister instances based on their health and load.
How It Works
An Application Load Balancer receives incoming application traffic and examines various details of the HTTP/HTTPS request (like headers, method, URL, etc.) to decide which server or service to route the traffic to. It uses sophisticated routing rules considering these details, which allows for dynamic response to incoming traffic, optimizing the resource utilization and performance of server resources.
Example Scenario
Consider a web application with multiple components:
- A static content division that serves images, CSS, and JavaScript.
- A dynamic content division that handles business logic and user authentication.
- An API component that provides data to mobile applications.
An Application Load Balancer could be set up to direct requests to /static to servers optimized for fast content delivery, requests to /api to servers designed for API responsiveness, and other requests to a pool handling dynamic content. This ensures that each type of request is handled by the server setup best suited to manage it efficiently.
This type of setup not only improves the overall responsiveness and efficiency of the web application but also provides a way to scale individual components independently based on their specific load, further optimizing resource use and cost.
Summary
An Application Load Balancer (ALB) is a sophisticated load balancing solution that operates at the application layer (Layer 7) of the OSI model. It’s designed to route web traffic based on the content of HTTP/HTTPS requests, making it highly effective for complex web applications. Key features include content-based routing, host and path-based routing, support for microservices and container-based architectures, SSL/TLS offloading, and support for WebSocket and HTTP/2 protocols.
ALBs can distribute traffic among servers based on URL paths, domain names, or other details within the request, allowing for precise control and optimization of traffic flow. This capability is particularly beneficial for applications with diverse components like static content, dynamic content, and APIs, as it allows each type of request to be handled by the most appropriate server or service. This enhances performance, optimizes resource utilization, and facilitates the independent scaling of application components.
Useful Links
https://sanchitgurukul.com/proxy
https://sanchitgurukul.com/load-balancer
