Day 8: AWS Solutions Architect Professional Prep — Load Balancing Deep Dive

How do major websites stay fast even when millions of people are clicking at the same time? They avoid virtual traffic jams using something called an AWS Load Balancer (ELB).

These tools might be compared  to a specialized traffic manager who has the job to efficiently distributing incoming requests across multiple servers and send incoming requests to the best available server and ensure no single server gets overloaded.Better speed, better stability, and better customer experience is the value they provide

Q1: What are the three main types of AWS Load Balancers?

AWS Elastic Load Balancing, or ELB, offers three main types of load balancers, each specialized for a different job: the Application Load Balancer (ALB), the Network Load Balancer (NLB), and the Gateway Load Balancer (GWLB).

  1. Application Load Balancer (ALB): This is the Smart Router because it does not just look at the physical address of the request but actually reads the content. It handles web protocols like HTTP, HTTPS, and WebSockets. Operates at Layer 7 (Application).
  1. Network Load Balancer (NLB): This is the High-Speed Express Lane; offers ultra-low latency. It handles basic network traffic like TCP, UDP, and TLS. Operates at Layer 4 (Transport)
  1. Gateway Load Balancer (GWLB): This is the Security Checkpoint; It is designed specifically for security and network appliances. It operates at Layer 3 (Network)

Q2: Which Load Balancer should I use for a standard website or API?

You should choose the Application Load Balancer (ALB). It is ideal for modern web apps, microservices, and API routing.

The ALB operates at Layer 7 (the Application layer). This means it is sophisticated enough to read the URL path or HTTP headers of a request. It does not just look at where the traffic is going but actually reads the content of the request

If you ask the ALB for /images, it knows to send you to the server that only handles photos. If you ask for /checkout, it sends you to the server that handles payments. This is known as path-based routing.The ALB is also the only type that supports advanced features like maintaining sticky sessions using cookies so a user stays on the same server.

Q3: Which Load Balancer should I use  if I need extreme speed or I am handling gaming traffic?

The NLB operates at Layer 4 (the Transport layer). It handles TCP, UDP, and TLS traffic, and does not understand HTTP content. This means that it does not look at the content of the request like an ALB does but just looks at the basic port and protocol.

It is built for extreme performance and ultra-low latency so it can handle millions of requests per second. This makes it ideal for high-volume TCP/UDP microservices, gaming, and real-time applications. You may call it  the High-Speed Express Lane. A key feature is that it preserves the client’s original source IP address, which is helpful for backend security and logging.

Q4: How do Load Balancers know if a server is healthy?

Regardless of which Load Balancer you choose, it needs a way to constantly monitor the servers they are directing traffic to know if the backend servers are actually ready to receive traffic. It does this through health checks

An ALB sends an HTTP or HTTPS request and expects a successful status code back. The return of a status code within the range 200–399 usually indicates success. A best practice is to use a lightweight path, like /health, for this check.

An NLB supports TCP, HTTP, or HTTPS health checks. A common check is a simple TCP check to see if the server port is open and listening. If a server fails too many checks, it is quickly removed from the rotation to prevent users from seeing errors. The thresholds can be adjusted for faster failover in critical systems.

GWLB relies on target group health checks, using TCP or custom ports

Q5: When should I use the Gateway Load Balancer (GWLB)?

The Gateway Load Balancer (GWLB) is specialised. It is used when network traffic must first pass through a security scanner (like a firewall or intrusion detection system) before reaching its final destination

It might be called an appliance traffic orchestrator. It operates at Layer 3 (Network) but uses a special protocol (GENEVE encapsulation) to ensure all traffic passes through the security appliance before moving forward. This allows the security gear to scale independently without complex routing changes. It is the best choice for security inspection architectures.

To summarize the crucial differences, ALB is Layer 7 (Application) and is the advanced router that is necessary for path-based routing and features like sticky sessions.NLB is Layer 4 (Transport) and it is built for raw speed, ultra-low latency, and preserving the source IP. GWLB is the Appliance Handler and Its job is to manage traffic for integrated security systems.Health Checks are critical for maintaining the stability of applications and enabling fast failure detection.