DEV Community

Cover image for ALB Vs NLB
Sabiha Ali
Sabiha Ali

Posted on • Originally published at Medium

ALB Vs NLB

Listed below are some features of NLB and ALB which can help us choose the right load balancer in the right scenarios.

Layers and Protocols

Application load balancer is a layer seven load balancer and it listens on HTTP & HTTPS that means it understands the information carried by HTTP or HTTPS protocol, but it will not understand any other layer seven protocols like SMTP, SSH or other custom protocols .

Network load balances function at layer 4 so they are a layer 4 device. This means that they can interpret the TCP,UDP but they cannot understand HTTP or HTTPS

Session Stickiness

Application load balancer is a layer 7 load balancer and it can listen to layer 7 content like custom headers, user location and application behavior, hence Application load balancer can inspect the layer 7 content and make the decisions based on this information. It supports cookies and session stickiness.

NLB cannot understand headers or cookies and they do not have any sessions stickiness because these are a layer 7 entities and NLB works with layer 4.

Unbroken SSL Passthrough

The one thing which we have to take care with ALB is the connection is always always terminated on the ALB, so you cannot have an unbroken SSL from your customers to the application instead every connection will be terminated in the load balancer and then a new connection is made to the application in the back. So an SSL certificate is mandatory for the ALB if you are expecting HTTPS traffic. An unbroken SSL could be very important to security teams and due to this they sometimes tend to leave out the ALB.

Whereas Network load balances can forward the TCP straight to the backend instances which means an unbroken encryption can be done without the load balancer terminating the connection and creating a new one.

Speed

Application load balances are slower than the network load balancers. Why? This is because Network load balancers work in the layer 4 whereas Application load balancers work in layer 7, so more layers or more levels of networks to process for the Application load balancer. So more the processing slower the results. So if you are very keen on the performance then you will have to think about going for Network load balancers. The wonderful thing about Network load balancers is, they are really fast and they can go up to millions of request per second.

Health Checks

Network load balancer and Application load balancer can both do a health check but Network load balancers can merely check the connection health. It will only check the ICMP ping, TCP handshake and it is not application aware, it cannot check the application health. Whereas application load balancer can also evaluate the application health, so in addition to just checking for a successful network connection, it also evaluates the application health.

Static IP Support

Another advantage of network load balancer is it can have a static IP configured which is useful for white listing if you have any corporate client firewalls.

Private link Support

Another important thing about the network load balancer is it can be used with private link to provide services to other VPC

Top comments (0)