Day 46 โ€” Elastic Load Balancers (ELB) in AWS

Today I dove into Elastic Load Balancing (ELB) โ€” a critical service in AWS that ensures high availability, scalability, and reliability of applications by distributing traffic across multiple targets (like EC2, containers, or IPs).


๐Ÿ” What is Load Balancing?

When deploying applications on clusters of servers, you don't want users to interact with servers directly. Instead, you provide a single endpoint, and behind the scenes a Load Balancer routes the incoming traffic to the appropriate backend servers.

๐Ÿšช Load Balancer Ports:

  • Frontend Port (Listener): Listens for incoming user requests

    • Examples: 80 (HTTP), 443 (HTTPS), 25 (SMTP)
  • Backend Port: Where your app/service is running on EC2/container

    • Examples: 80, 443, 8080, etc.

โš™๏ธ What is Elastic Load Balancer (ELB)?

Elastic Load Balancing (ELB) automatically distributes incoming application or network traffic across multiple targets, including:

  • EC2 instances

  • ECS containers

  • IP addresses

  • Lambda (for ALB only)

It works across multiple Availability Zones to improve fault tolerance and high availability.

๐Ÿ”— Learn more: https://aws.amazon.com/elasticloadbalancing/


๐Ÿงฑ Types of Load Balancers in AWS

1. ๐ŸŒ€ Classic Load Balancer (CLB)

  • Legacy load balancer

  • Operates at Layer 4 (TCP) or Layer 7 (HTTP)

  • Best for simple load balancing across EC2

  • Limited features compared to ALB/NLB

2. ๐Ÿง  Application Load Balancer (ALB)

  • Operates at Layer 7 (HTTP/HTTPS)

  • Smart routing based on:

    • Path-based routing (e.g., /images, /api)

    • Host-based routing (e.g., api.example.com)

    • Header/cookie inspection

  • Supports WebSockets and serverless (Lambda) targets

  • Ideal for microservices and modern web apps

3. โšก Network Load Balancer (NLB)

  • Operates at Layer 4 (TCP/UDP)

  • Handles millions of requests per second

  • Ultra-low latency, static IP, and TLS termination

  • Great for performance-critical, gaming, or VoIP apps

4. ๐Ÿšช Gateway Load Balancer (GWLB) (for advanced use cases)

  • Helps with third-party virtual appliances (e.g., firewalls, intrusion detection)

  • Not commonly used in beginner setups


โœ… ELB Benefits

  • High Availability: Works across AZs

  • Scalability: Automatically adapts to incoming traffic

  • Resilience: Replaces unhealthy targets automatically

  • Central Endpoint: Simple DNS for app access

  • Secure: Works with SSL/TLS and integrates with IAM/ACM


๐Ÿง  What I Learned Today

  • ELB is essential to scale and secure distributed applications

  • Choosing the right load balancer depends on the protocol, routing needs, and performance requirements

  • ALB is ideal for modern apps, while NLB is best for high-speed network-level needs

Next: Iโ€™ll explore Amazon CloudWatch


0
Subscribe to my newsletter

Read articles from Shaharyar Shakir directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shaharyar Shakir
Shaharyar Shakir