ALB vs NLB vs GLB in AWS (A quick guide)

Shamim Ahmed
Level Up Coding
Published in
3 min readSep 10, 2023

--

Application Load Balancer (ALB) vs Network Load Balancer (NLB) vs Global Load Balancer (GLB)

Photo by Gabriel Sanchez on Unsplash

AWS offers several load balancing services to distribute incoming network traffic across multiple targets (such as EC2 instances or containers) to ensure high availability, scalability, and fault tolerance. ALB (Application Load Balancer), NLB (Network Load Balancer), and GLB (Global Load Balancer) are three different load balancing services in AWS, and each has distinct features and use cases.

1. Application Load Balancer (ALB):

a) Layer: ALB operates at the application layer (Layer 7) of the OSI model.
b) Use Cases:
— Best suited for routing HTTP and HTTPS traffic.
— Ideal for load balancing multiple applications or microservices on a single port, as it supports content-based routing and can route requests to different target groups based on URL paths or hostnames.
— Provides advanced features like host-based routing, path-based routing, and support for container-based applications.
c) SSL Termination: ALB can terminate SSL/TLS connections from clients, offloading SSL processing from backend servers.
d) Health Checks: Supports health checks at the application layer.
e) Sticky Sessions: Provides support for sticky sessions.
f) WebSockets: Supports WebSocket traffic.
g) HTTP/2: Supports HTTP/2, providing better performance for modern web applications.

2. Network Load Balancer (NLB):

a) Layer: NLB operates at the transport layer (Layer 4) of the OSI model.
b) Use Cases:
— Ideal for handling TCP/UDP traffic, including custom protocols, non-HTTP protocols, and high-performance workloads.
— Commonly used for load balancing databases, gaming applications, and other services that rely on raw transport layer connections.
— Works well for scenarios where source IP preservation is important.
c) High Throughput: NLB is designed for high throughput and low-latency use cases.
d) TLS Termination: NLB supports TLS termination, but it’s not as feature-rich as ALB in handling HTTPS traffic.
e) Health Checks: Supports health checks at the transport layer.

3. Global Load Balancer (GLB):

a) Layer: GLB is not a standalone AWS service but refers to a global load balancing solution that typically involves multiple AWS services and configurations.
b) Use Cases:
— GLB is used to distribute traffic across multiple AWS Regions or data centers to achieve global redundancy and disaster recovery.
— It involves configuring DNS-based solutions, such as Amazon Route 53, with failover policies and latency-based routing to direct traffic to the nearest healthy endpoint.
c) Multi-Region: Allows for global load balancing across multiple AWS Regions.
d) DNS-Based: GLB primarily relies on DNS for routing decisions.
e) Failover and Latency-Based Routing: GLB solutions often use these techniques for resilience and performance optimization.

Summary Note:

ALB is best for HTTP and HTTPS traffic, especially for microservices and web applications.

NLB is designed for low-level, TCP/UDP traffic with a focus on high performance and source IP preservation.

GLB refers to a global load balancing solution that typically involves configuring DNS-based routing across multiple AWS Regions or data centers for redundancy and disaster recovery.

Your choice of load balancer should depend on your specific use case and the type of traffic you need to handle.

--

--

Engineer @McKinsey & Co. Passionate developer who loves to code 👨🏻‍💻, learn, and share knowledge 🌎. LinkedIn: https://linkedin.com/in/shamimio