AWS Elastic Load Balancer (ELB) automatically distributes your web applications' incoming traffic to multiple destinations, such as EC2 instances, containers, or IP addresses, in one or more availability zones.
ELB allows you to monitor the health of your various targets and forwards traffic only to healthy targets. It also scales automatically based on incoming traffic over time.
The different types of AWS Elastic Load Balancers
The following comparison table will help you understand the differences between the load balancers offered by AWS ELB.
The GWLB is for applications that require secure remote access, while the others are for load balancing for web applications or applications at layer 4 or 7.
Application Load Balancer (ALB) | Network Load Balancer (NLB) | Classic Load Balancer (CLB) | Gateway Load Balancer (GWLB) | |
---|---|---|---|---|
Assisted traffic |
|
|
|
|
Load distribution | Application layer (Layer 7) | Transport layer (Layer 4) | Transport or application layer (Layer 4 / 7) | Network layer (Layer 3) |
Advanced functions |
|
|
|
|
Flexibility | Routing based on URLs, HTTP headers, methods and status codes | Routing based on the destination IP and port | Routing based on load balancing rules | Routing based on traffic and routing rules |
Scaling |
|
|
|
|
Price | Billing based on the number of requests | Billing based on the number of hours of use and transferred data | Billing based on the number of requests | Billing based on the number of remote access connections and the amount of data transferred |
Listener and Target: 2 Key Concepts
Listeners and target groups are two key concepts of ELB:
- Listeners are gateways for incoming traffic that are configured to listen on a specific port and also accept a specific transport protocol. When a listener receives a request, it forwards it to a Target Group based on the routing rules configured for that listener.
- Target Groups, in turn, are groups of target instances that receive traffic forwarded by Listeners. These can be EC2 instances, Amazon ECS or EKS containers, or Lambda functions. A target group is configured to use a specific protocol and port to communicate with the target instances.
These core concepts when using AWS Elastic Load Balancer allow you to configure advanced traffic forwarding scenarios for your application, such as load balancing across multiple targets, supporting multiple protocols and ports, or traffic to groups of targets depending on specific request conditions.
Amazon Elastic Load Balancer: The Ideal Solution?
Amazon Elastic Load Balancer is an ideal solution for load balancing your application. The choice of load balancer depends on your application requirements, such as scalability, security, or connection management.