Consistent Hashing – A Complete Solution

One distribution scheme which doesn’t depend on the number of servers is Consistent Hashing.

Consistent hashing is a load-balancing algorithm that can be used to implement subsetting. It involves mapping each server to a point on a circle or hash ring, with the circle representing the range of all possible hash values. Requests are then mapped to a point on the circle based on their hash value. The server responsible for handling the request is the server located immediately clockwise from the request’s point on the circle.

Consistent hashing has several advantages over other load-balancing algorithms. Some of them listed below:

  • Scalability: It is highly scalable, as the addition or removal of a server only affects a small subset of the total workload.
  • Fault Tolerance: It is also fault-tolerant, as the removal of a server only affects the subset of the workload that was handled by that server. 
  • Handling Uneven Distributed Workloads: Additionally, consistent hashing can handle unevenly distributed workloads by partitioning the circle into multiple virtual nodes for each server, which can balance the workload across multiple servers.

Example of how consistent hashing solves the problem of distributing requests to servers in case of adding or removing of servers.


Load Balancing through Subsets in Distributed System

Before diving into what is subsetting in load balancing, we should first understand what is load balancing, and why subsetting is all the more important in load balancing.

Load balancing is the process of distributing incoming network traffic/workload across multiple servers or nodes in a network system. The main aim of load balancing is to optimize resource utilization, maximize throughput and minimize response time (overload) on any single server or resource.

Similar Reads

What is Subset Load Balancing?

As the name itself suggests, subset load balancing partitions the system of available nodes into multiple subsets and distributes the workload among smaller subsets of resources. This is required as it helps the system to handle more traffic, reduce response times, and increase the reliability and fault tolerance of the system. Thus, using subsets, enhances resource availability and scalability as well, by reducing overall latency....

Designing on a larger scale: Distributed Hashing

Scaling out is a technique that involves adding more nodes to the system to increase its capacity....

Consistent Hashing – A Complete Solution:

One distribution scheme which doesn’t depend on the number of servers is Consistent Hashing....