Load Balancing | Load Balancer | Consistent hashing
The concept of taking N servers to handle requests and trying to balance evenly in all of them is called Load Balancing . Good Read Good Read2 Good to watch Video Take away: * Load balancing distributes requests across servers. * You can use `hash(r_id) % n_servers` to get the server index for a request `r_id`. -> Drawback: if you add an extra server `n_servers` changes and `r_id` will end up on a different server. This is bad because often we want to map requests with the same ids consistently to the same servers (there could e.g. be cached data there that we want to reuse). * "Consistent hashing" hashes with a constant denominator `M`, e.g. `hash(r_id) % M`, and then maps the resulting integer onto a server index. Each server has a range of integers that map to their index. Consistent Hashing : Good to watch Load Balancing is a key concept to system design. One of the popular ways to balance load in a system is to use the concept of consistent hashing. Con...