What is a load balancer, and why is it used?
EasyConceptLoad Balancing
Answer
A load balancer is a server or managed service that receives client traffic and forwards each request to one of several backend servers. It enables horizontal scaling, improves availability by routing around failed servers, and gives clients a single stable address.
- Health checks: it probes backends periodically and stops sending traffic to unhealthy ones.
- Extra duties: TLS termination, connection pooling, compression and request logging are often handled at the load balancer.
- Placement: between clients and web servers, and often between internal tiers such as application servers and backend services.
- Redundancy: run load balancers in active-passive or active-active pairs, or use a managed cloud load balancer, so that they do not become a single point of failure.
More in Load Balancing
| # | Problem | Platform | Difficulty | Open | 1st1st Visit | 2nd2nd Visit | RevRevise |
|---|---|---|---|---|---|---|---|
| 1 | What is a load balancer, and why is it used? | Concept | Easy | Read the answer to What is a load balancer, and why is it used? | |||
| 2 | What are the common load-balancing algorithms, and when would you use each? | Concept | Medium | Read the answer to What are the common load-balancing algorithms, and when would you use each? | |||
| 3 | What is the difference between Layer 4 and Layer 7 load balancing? | Concept | Medium | Read the answer to What is the difference between Layer 4 and Layer 7 load balancing? | |||
| 4 | What is consistent hashing, and why is it used? | Concept | Hard | Read the answer to What is consistent hashing, and why is it used? |