Serksa
All Concepts
Performance & Scaling

Load Balancing

1

What is it?

<strong>Load balancing</strong> is distributing incoming network traffic across multiple servers to ensure no single server gets overwhelmed. It improves reliability, performance, and scalability.

2

Think of it like...

The Supermarket Checkout Analogy

A supermarket manager directs customers to the shortest checkout line. Load balancers do the same with web requests, sending each to the least busy server.

🛒

Customers (Requests)

Need to check out

👨‍💼

Manager (Load Balancer)

Directs to shortest line

💳

Cashiers (Servers)

Process checkouts

3

Visual Flow

🌐Users

Send Requests

⚖️Load Balancer

Distributes Traffic

🖥️Servers

Handle Requests

4

Where you see it

1

Request arrives

User visits your website

2

Load balancer receives

Acts as single entry point

3

Chooses a server

Uses algorithm (round-robin, least connections, etc.)

4

Forwards request

Sends request to selected server

5

Returns response

Server processes and returns through load balancer

5

Common Mistake

Wrong

"Load balancing is only for huge websites"

Correct

Load balancing is valuable for <strong>any growing application</strong>. It provides redundancy (if one server fails, others continue), enables zero-downtime deployments, and allows horizontal scaling.

💡 Real-World Example

E-commerce site during Black Friday:

1

Traffic spikes from 1,000 to 100,000 users per second

2

Load balancer distributes across 50 servers instead of 5

3

If one server crashes, others handle its traffic automatically

4

Users experience no downtime or slowdowns