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
- 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.
- 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.
- 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 Point||Classic LB||Application LB||Network LB|
|Protocols||TCP, SSL/TLS, HTTP, HTTPS||HTTP, HTTPS||TCP, TLS/UDP|
|Performance the ability to handle more traffic||better||good||best|
|Sticky Session (for session-based applications)||Yes (redirect to the same machine)||Yes (redirect to the same target)||No|
|Load balancing to multiple ports on the same instance||No||Yes||Yes|
|Layer of OSI||4,7||7||4|
Let us know understand in depth with below figure
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.
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.