Elastic Load Balancing (ELB)

Elastic Load Balancing is a managed service of Amazon Web Services that distributes incoming traffic across Amazon EC2 instances, containers, and virtual appliances organized as target groups, improving system fault tolerance. It integrates tightly with Amazon Elastic Container Service (ECS), Amazon Elastic Kubernetes Service (EKS), Amazon VPC, and AWS WAF to add security and monitor performance in real time.

Key points

  • Classic Load Balancer (CLB) — the previous generation of ELB; routes TCP, HTTP, or HTTPS traffic at layer 4 and layer 7; used for existing EC2-Classic instances. Current AWS documentation labels it the “previous generation of load balancers” and directs customers to migrate to a current-generation load balancer; it remains available for existing configurations, and AWS provides a console migration wizard to Application or Network Load Balancers, but no new features have been added since 2020 and it is not recommended for new workloads.
  • Application Load Balancer (ALB) — routes HTTP and HTTPS traffic at layer 7; offers path-based routing, host-based routing, query-string parameter-based routing, and source IP address-based routing.
  • Network Load Balancer (NLB) — routes TCP, UDP, and TLS traffic at layer 4; suitable for high-performance and low-latency applications.
  • Gateway Load Balancer (GWLB) — combines a transparent network gateway with a load balancer, operating at layer 3 (network layer) using GENEVE encapsulation; suitable for third-party networking appliances and simplifies tasks to manage, scale, and deploy virtual appliances.
  • Choosing between them: use the Application Load Balancer for HTTP request load balancing; use the Network Load Balancer for layer-4 (TCP, UDP) load balancing and extreme performance or low-latency needs; use the Classic Load Balancer only to maintain an existing application built within the Amazon EC2-Classic network; use the Gateway Load Balancer to deploy and run third-party virtual appliances.
  • Internet-facing ELB — the load balancer has public IPs.
  • Internal-only ELB — the load balancer has private IPs.
  • Offers sticky sessions, a process to route requests from the same client to the same target.
  • Monitors servers’ health and performance in real time using Amazon Cloudwatch metrics and request tracing.
  • Integrates with every AWS service throughout an application, and is tightly integrated with Amazon EC2 and Amazon ECS/EKS.
  • Distributes traffic across existing targets; it does not add or remove them. Adjusting the number of backing EC2 instances in response to demand is the role of Amazon EC2 Auto Scaling, commonly paired with an ALB/NLB target group.

Sources