What is Load Balancer in AWS

In this post we will be seeing What is Load Balancers in AWS, We will also understand What is the use of Load Balancers, Load Balancer Types and Components of Load Balancers.

So let’s get started,

Elastic Load Balancer automatically distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, IP addresses, and Lambda functions.

Load Balancer is used for Fault Tolerance and High availability of an application.


Types of Load Balancer

  1. Application Load Balancer: An Application Load Balancer makes routing decisions at the application layer (HTTP/HTTPS), supports path-based routing, and can route requests to one or more ports on each container instance in your cluster. It works on 7th Layer of OSI. You add listeners to your load balancers. Listener basically checks for connection requests from the clients and routes based on the rules you’ve defined. Rules consist of conditions, priority and target group.
  2. Network Load Balancer: A Network Load Balancer makes routing decisions at the transport layer (TCP/SSL). It can handle millions of requests per second. Just like Application Load Balancer, Network Load Balancer also consists of listeners, that listens to the client connection requests.
  3. Classic Load Balancer: A Classic Load Balancer makes routing decisions at either the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS). Classic Load Balancers currently require a fixed relationship between the load balancer port and the container instance port.

Let’s compare All the load Balancers.

Comparison PointClassic LBApplication LBNetwork LB
Performance the ability to handle more trafficbettergoodbest
Host/Path-based routingNoYesNo
Sticky Session (for session-based applications)Yes (redirect to the same machine)Yes (redirect to the same target)No
Static/Elastic IPNoNoYes
Load balancing to multiple ports on the same instanceNoYesYes
Layer of OSI4,774

Let us know understand in depth with below figure

Load Balancer

EC2 instances can have either public ip or private ip, but every EC2 instance will have private ip.

It is not necessary that all traffic will go from ELB in above case Application Load Balancer, Application LB supports only HTTP/HTTPS requests, Any requests apart from HTPP/HTTPPS directed to any of the EC2 instance will directly interact with EC2 instance bypassing Application LB.

Components of LB

Let us understand what is Listener, Target group and Target.

The components of a basic Application Load Balancer
Listener. Target group and Target

Listener: Listens to all incoming traffic in respective port.

Target: A target is independent EC2 machine.

Target Group: Collection of EC2 machines is called Target group.

I hope you understood what are load balancer, its types and components of it. In the next post we will be seeing Health Check in Load Balancers.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s