What is Load Balancing?
You'll learn: How load balancers distribute incoming traffic across multiple servers to boost availability and performance.
The Core Idea
Imagine you're running a popular web application. A single server can only handle so many requests per second before it becomes overwhelmed—response times spike, requests fail, or the server crashes entirely. Load balancing is the practice of distributing incoming network requests across multiple servers (often called a "server pool" or "backend servers") so that no single server bears too much burden.
A load balancer sits between your users and your servers. When a request arrives, the load balancer decides which server should handle it based on various algorithms—round-robin (rotating through servers), least-connections (sending to the server with fewest active requests), or more sophisticated methods.
Why It Matters
Load balancing directly addresses scalability bottlenecks you've already learned about. When horizontal scaling (adding more servers) is your strategy, you need a way to intelligently route traffic to those servers. Without a load balancer, users would need to know which specific server to contact, and there'd be no automatic failover if one goes down.
Load balancers also improve availability: if one server fails, the load balancer detects this (via health checks) and stops routing traffic there, ensuring your application stays online even during partial failures.
The Connection to Scalability
This builds directly on stateless application design—if your servers don't store session data locally, any server can handle any request, making load balancing effective. It also complements caching and asynchronous processing by ensuring that even with optimizations, you can scale horizontally when demand grows.
Key Takeaway: Load balancers distribute traffic across multiple servers to prevent overload, improve response times, and maintain availability even when individual servers fail.