Classic Load Balancer (CLB)

The Classic Load Balancer (CLB) is an AWS service that provides basic load balancing capabilities for EC2 instances and is designed to operate at both the Application Layer (Layer 7) and Transport Layer (Layer 4) of the OSI model. It supports routing traffic based on TCP, HTTP, and HTTPS protocols. Although CLB is considered legacy compared to the newer ALB and NLB, it remains useful for simple and traditional load-balancing needs.

Key Features of CLB:

  1. Layer 4 and Layer 7 Load Balancing:

    • Balances traffic at the transport layer (TCP) and application layer (HTTP/HTTPS).
  2. Single Point for DNS:

    • Provides a single DNS name for distributing traffic across multiple backend EC2 instances.
  3. Health Checks:

    • Monitors the health of EC2 instances and routes traffic only to healthy ones.
  4. SSL Termination:

    • Supports SSL/TLS termination at the load balancer, reducing the burden on backend servers.
  5. Sticky Sessions:

    • Enables session persistence by directing requests from a client to the same backend instance.
  6. Cross-Zone Load Balancing:

    • Distributes traffic evenly across multiple Availability Zones.
  7. Integration with Auto Scaling:

    • Automatically adjusts backend instance capacity based on load.

Real Time Use Cases:

  1. Simple Applications:

    • Ideal for applications that don’t require advanced routing features or high performance.
  2. Legacy Architectures:

    • Supports applications designed to work with CLB, where transitioning to ALB or NLB is not yet feasible.
  3. Basic HTTPS Applications:

    • Provides SSL/TLS offloading for secure communication.
  4. Hybrid Workloads:

    • Balances HTTP, HTTPS, and TCP traffic for workloads with mixed requirements.

How It Works:

  1. Request Handling:

    • The client sends a request to the CLB's DNS name.

    • The CLB routes the request to one of the healthy EC2 instances.

  2. Health Checks:

    • CLB performs health checks (HTTP, TCP, or HTTPS) to determine the availability of backend instances.
  3. Traffic Distribution:

    • Distributes incoming traffic among backend instances using round-robin or least-connections algorithms.
  4. Response Forwarding:

    • The backend instance processes the request and sends the response back to the client via the CLB.

NOTE:

The Classic Load Balancer (CLB) is a simple, reliable solution for basic load-balancing needs but is best suited for legacy or less demanding applications. For modern architectures, AWS recommends using Application Load Balancer (ALB) or Network Load Balancer (NLB) due to their advanced features and scalability.

Summary:

Classic Load Balancer (CLB)

  • Layer: Operates at both Layer 4 and Layer 7.

  • Purpose: Basic load balancing for HTTP, HTTPS, and TCP traffic.

  • Features:

    • SSL termination and health checks.

    • Sticky sessions for session persistence.

  • Use Cases:

    • Legacy applications.

    • Simple workloads without advanced routing needs.