Tag Archives: Difference between load balancers in AWS

Elastic Load Balancers in AWS

Know different Load Balancers in AWS

A quick post about different types of load balancers in AWS and the difference between them.

Elastic Load Balancers in AWS!

AWS offers a load balancing feature under EC2 compute service. It offers basically 4 types of load balancers :

  1. Application Load Balancer
  2. Network Load Balancer
  3. Gateway Load Balancer
  4. Classic Load Balancer

We will quickly go through them one by one and finally compare them with each other.

Application Load Balancer

  • It’s a Layer 7 load balancer. Operates at the application layer.
  • Aimed to handle HTTP and HTTPS traffic
  • It is capable of routing based on path patterns.
  • SSL can be offloaded to it. Supports SNI.
  • Even authentications can be offloaded to it.
  • Targets can be EC2, Lambda, and IP addresses.
  • Step by step ALB creation

Network Load Balancer

  • It’s a layer 4 Load Balancer. Operates at the transport layer.
  • Aimed to handle TCP, UDP, and TLS traffic
  • Uninterrupted end to end encryption till target
  • Ultra-low latency load balancers capable of handling millions of requests per second.

Gateway Load Balancer

  • It’s a Layer 3 Load Balancer. Operates at the network layer.
  • Aimed to handle virtual appliances traffic on GENEVE protocol.
  • Scale virtual appliances like Firewalls, IDP, etc. using this LB

Classic Load Balancer

  • It’s a combination of ALB and NLB offered by AWS formerly (with reduced features).
  • New deployments should not be using it.
  • Its existence is only for compatibility for old EC2-Classics running customers.

Lets compare all 4 Elastic Load Balancers side by side –

ALBNLBGLBCLB
OSI model layer7437 and 4
Protocol supportedHTTP, HTTPSTCP, UDP, TLSGENEVEHTTP, HTTPS, TCP
Supports static IP for ELBNo, only DNS nameYesNoNo, only DNS name
SSL offloadingYesYes (TLS termination)NoYes
SNI supportYesYesNoNo
Authentication offloadingYesNoNoNo
End to end encryptionNo if using SSL offloadingYesNoYes
Sticky sessionsYesYesYesYes
Path patternsYes
Cross zone load balancingEnabled by defaultYesYesDisabled. Enable it manually
Type of registered targetsInstance, Lambda, IPInstance, IPInstance, IPInstance,IP
Use casesWebsites, web applicationsApplication requiring low latency load balancingLoad balancing or scaling virtual appliances for IDP, firewall etc.Web applications.

I mentioned the commonly used features comparison above. Amazon published a very good comparison of all load balancers on this page.