Load Balancer / API Gateway handles request from multiple sources and redirects it onto needed Server from a cluster of endpoints
Done In ways such as:
- Using fixed routing
Suppose we route all /customers to one server, /users to another server.
A middle-man API Gateway can route calls to the distributed servers via RPC or HTTP calls
This is an example of a Microservices Architecture
- Using some hash function in range [0,N] - by modulo
When client requests, a hash function maps (randomly) to any one of the N servers. And the request is redirected to that server.
This way is good but has issues like:
- Handling Failures 2) Even Distribution of load
An alternative for that becomes using something like Consistent Hashing