First setting up for some terminology, In AWS, load balancers are called Elastic Load balancers.
AWS loves to keep word “elastic”(marketing), Infront to many standard aws services like EC2, ECS,EKS and load balancers. For Example, Compute services have “elastic” Infront of them Elastic Compute Cloud (EC2), Elastic Container Services (ECS) , Elastic Kubernetes(EKS). This term “Elastic” in aws signifies the ability of these services to quickly scale up or down based on demand, providing elasticity and flexibility to the infrastructure.
Similarly, to balance load between these compute services it uses the word elastic for load balancers as well.
In AWS, Elastic Load Balancers are used to distribute traffic to various AWS services (EC2 instances, EKS, ECS or another load balancer).
Load Balancers can be configured with health checks for different End points or service present in aws.
For example, if an EC2 instance goes down. we can utilize health checks and reroute the traffic to new or other EC2 instances in Autoscaling group without disrupting the traffic between user and the service.
Mainly there are three types of load balancers:
All load balancers mentioned above operate at different levels of osi model. Their capabilities mostly are determined by the OSI level there are operating with.
Remember: AWS load Balancers only support routing between different Availability Zone not Regions.
Below table summaries the load balancers:
Load Balancer Type | OSI Level | Use Cases |
Application Load Balancer (ALB) | Layer 7 | HTTP/HTTPS traffic, path-based routing, content-based routing, TLS termination, WebSockets |
Network Load Balancer (NLB) | Layer 4 | TCP, UDP, TLS passthrough, extreme performance |
Gateway Load Balancer (GWLB) | Layer 3 | Managed gateway that scales, secures, and monitors traffic across VPCs, on-premises networks, and AWS Transit Gateways |
Classic Load Balancer with EC2 classic is being discontinued