Load balancer
A server that spreads requests across several machines so none of them gets overloaded.
Example
3,000 requests per second arrive and there are 3 servers: the load balancer sends about 1,000 to each.
Test yourself: Load balancer
Load balancers
What does a load balancer do?
With 30,000 requests per second and servers of 10,000, the load balancer gives 10,000 to each of the 3.
Load balancers
If a server goes down, the load balancer sends its requests to the servers still alive.
With 3 servers and 1 down, the other 2 get everything. The user doesn't see the error, at most a bit more delay.
Proxies
A reverse proxy can act as a load balancer, but a load balancer doesn't always act as a reverse proxy.
A reverse proxy in front of 3 servers can give 1/3 to each; a load balancer adds nothing with just 1 server.
0/3
â–¶ PlayLessons that use it
What system design is
Think before you build
Load balancers
Sharing the work
Kinds of load balancers
Not all load balancers are alike
Clusters
Many machines, one system
Proxies
A middleman in between
Availability
Counting the nines
Scaling
Bigger or more machines
Databases
Where data is kept
API Gateway
1 single front door
Rate limiting
A cap on requests
Idempotency
Repeat without breaking anything
Service discovery
Where is that service?
Disaster recovery
Running again after the disaster
The design steps
From data to bottlenecks
Designing a URL shortener
A long link in 7 characters
