A certain number of client request some number of resources to backends. Load balancer stays between client and backend and at a high level can perform critical tasks, including:
-Service discovery: what backends are available in the system? What are their addresses?
-Health checking: what backends are healthy and ready to accept requests?
-Load balancing: what algorithm should be used to balance individual requests across the healthy backends?
What are the benefits of network load balancing?
The proper use of load balancing in a distributed system provides several benefits:
- Naming abstraction: the client addresses the load balancer through a predefined mechanism and then the activity of name resolution can be delegated to the load balancer. This kind of mechanism includes built-in libraries and well known DNS/IP/port locations.
- Fault tolerance: through the healt checking and various algorithmic techniques, the load balancer can route around a bad or overloaded backend. This means that an operator can fix the problem with the needed time instead of treat it as an emergency.
- Cost and performance benefits: distributed system networks are rarely homogeneous. Probably the system span different zones and regions and between zones, oversubscription is normal. An intelligent load balancing is able to keep traffic requests within the zones as much as possible, so performance increased (less latency) and the cost of the whole system is reduced (less bandwidth and fiber needed between zones).