What does a load balancer do?
Options
- It stores the data of the application itself
- Spreads requests over servers, skipping sick ones (Correct option)
- It compresses images before sending them out
- It writes the logs that the application emits
Answer
Distributes incoming requests across several servers and stops sending traffic to unhealthy ones
Why
A load balancer sits in front of a group of identical servers. Clients talk to its single address; it forwards each request to one of the servers.
This spreads the work, lets you add servers as traffic grows, and keeps the site up if one server fails: health checks detect it and stop sending it traffic.
Examples: Nginx, HAProxy, AWS ALB.
Remember
Load balancer = traffic distributor + health checks.