What is an AWS elastic load balancer and how does it work?

Load balancers are used to direct incoming requests to multiple targets. The number of resources behind a load balancer can be modified as per requirement without disrupting the application’s availability. 

widget

AWS offers elastic load balancers (ELB) to manage incoming requests from clients to multiple resources. ELB monitors the health of the registered target, ensuring that request is only forwarded to healthy targets. Targets are instances like EC2 instances and IP addresses that receive incoming traffic routed by the load balancer based on the attributes of each request. These targets are organized into a logical entity called a target group. When ELB identifies that a target is unhealthy, it stops routing the requests to the target. 

Load balancers can be configured to accept incoming requests by specifying listeners. A listener process checks the connection requests based on the port and protocol specified during the configuration of the load balancer. 

Commonly used ELBs

There are multiple types of load balancers available in AWS. The commonly used ones are:

Application Load Balancer (ALB)

ALB is designed to route traffic based on the request’s content, ideal for HTTP/HTTPS protocol based applications. ALB receives a request, examines the request’s content (URL, host, and headers). Based on this information, it makes intelligent routing decisions.

Network Load Balancer (NLB)

NLB works at the transport layer of the OSI model. It is designed to manage the high number of requests, resulting in high throughput and low latency. NLB offers high transport layer efficiency as it works on the transport layer level.

Benefits

  • Improved scalability: ELBs automatically distribute incoming application traffic across multiple instances, ensuring that no single instance is overwhelmed. This helps maintain application performance as traffic increases.

  • High availability: By routing traffic to multiple instances across different Availability Zones (AZs), ELBs ensure that your application remains available even if one or more instances or AZs fail.

  • Fault tolerance: ELBs detect unhealthy instances and reroute traffic to healthy ones, minimizing the impact of instance failures on application availability.

  • Automatic traffic distribution: ELBs dynamically adjust to changes in traffic volume, automatically scaling up or down to handle varying loads without manual intervention.

  • Security: ELBs can integrate with security features like AWS Web Application Firewall (WAF) to protect applications from common web exploits. They also support SSL/TLS termination to encrypt and decrypt data, enhancing security.

How does an ELB work?

When a client sends a request to access an application, the request first goes to the associated Elastic Load Balancer (ELB), which can be an Application Load Balancer (ALB), Network Load Balancer (NLB), or Gateway Load Balancer (GLB). The load balancer evaluates the health of the targets in the attached target groupsTargets are the resources that handle the requests sent by the load balancer. Each target group is associated with specific targets and has its own health checks, which determine whether a target is considered healthy or unhealthy. using health checks. If any target is found to be unhealthy, it is temporarily removed from the target group. Based on the type of load balancer and its routing rules, the request is forwarded to a specific target group. For ALBs, requests are routed based on rules like URL paths or host headers. NLBs forward traffic based on TCP/UDP protocols, and GLBs route based on network or transport layer information. Once the request reaches the target group, the healthy targets process it and generate a response. The load balancer then receives this response and sends it back to the client. Different types of target groups include instances (EC2), IP addresses, Lambda functions, containers, and network interfaces, each serving specific purposes and configurations.

canvasAnimation-image

Test your knowledge

Let’s test your knowledge of ELB

1

Which layer of the OSI model does the Application Load Balancer (ALB) operate at

A)

Transport layer

B)

Network layer

C)

Application layer

Question 1 of 30 attempted

Conclusion

AWS Elastic Load Balancers (ELB) are essential for efficiently distributing incoming requests to multiple healthy targets, ensuring high availability and reliability. By offering different types of load balancers like ALB and NLB, ELB provides seamless scalability and maintenance, which is crucial for modern applications.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved