Glossary

Load Balancing

TL;DR

Load balancing is the distribution of network or application traffic across multiple servers to optimize resource utilization, maximize throughput, and ensure high availability.


Concept

Load balancing is a technique used to distribute workloads evenly across multiple computing resources, such as servers, network links, or disk drives. It prevents any single resource from becoming overwhelmed, improving application performance, reliability, and scalability.

Key features and concepts of load balancing include:

  1. Traffic Distribution: Evenly distributes incoming requests across multiple backend servers to prevent overloading any single server.

  2. High Availability: Ensures application availability by automatically redirecting traffic away from failed or unhealthy servers.

  3. Scalability: Enables horizontal scaling by adding more servers to handle increased load without changing application architecture.

  4. Health Monitoring: Continuously monitors server health and removes unhealthy servers from the load balancing rotation.

  5. Session Persistence: Maintains user session continuity by directing subsequent requests from the same client to the same server.

  6. SSL Termination: Handles SSL/TLS encryption and decryption, offloading CPU-intensive cryptographic operations from backend servers.

Load balancing algorithms include:

  • Round Robin: Distributes requests sequentially across servers
  • Weighted Round Robin: Considers server capacity when distributing requests
  • Least Connections: Sends requests to the server with the fewest active connections
  • IP Hash: Distributes requests based on client IP address for session persistence
  • Weighted Least Connections: Combines connection count with server weights

Types of load balancers:

  • Hardware Load Balancers: Physical appliances designed for high-performance load balancing
  • Software Load Balancers: Applications that provide load balancing functionality (e.g., NGINX, HAProxy)
  • Cloud Load Balancers: Managed services provided by cloud providers (e.g., AWS ELB, Google Cloud Load Balancing)

Benefits of load balancing include:

  • Improved Performance: Faster response times through distributed workload
  • Enhanced Reliability: Eliminates single points of failure
  • Scalability: Easy addition of servers to handle increased demand
  • Flexibility: Support for various traffic distribution algorithms
  • Security: Centralized point for implementing security policies

Load balancing is commonly used for:

  • Web application scaling
  • Database load distribution
  • API traffic management
  • Content delivery optimization
  • Microservices communication
  • Multi-region failover

Organizations implement load balancing to improve application performance, ensure high availability, enable horizontal scaling, and maintain consistent user experience during traffic spikes. It’s a fundamental component of modern web architectures and cloud infrastructure.

Related words: CDN DNS Caching