Consistent Hashing - Need For Consistent Hashing

Need For Consistent Hashing

While running collections of caching machines some limitations are experienced. A common way of load balancing cache machines is to put object in cache machine number . But this will not work if a cache machine is added or removed because changes and every object is hashed to a new location. This can be disastrous since the originating content servers are flooded with requests from the cache machines. Hence consistent hashing is needed to avoid swamping of servers.

Consistent hashing maps objects to the same cache machine, as far as possible. It means when a cache machine is added, it takes its share of objects from all the other cache machines and when it is removed, its objects are shared between the remaining machines.

The main idea behind the consistent hashing algorithm is to associate each cache with one or more hash value intervals where the interval boundaries are determined by calculating the hash of each cache identifier. (The hash function used to define the intervals does not have to be the same function used to hash the cached values. Only the range of the two functions need match.) If the cache is removed its interval is taken over by a cache with an adjacent interval. All the remaining caches are unchanged.

Read more about this topic:  Consistent Hashing

Famous quotes containing the word consistent:

    We should be careful never to imagine, that the wedding-day is the burial of love, but that in reality love then begins its best life; and if we set out upon that principle, and are mindful to keep it up, and give due attention and aid to the progress of love thus brought into the well ordered well sheltered garden, we may enjoy I believe as much happiness as is consistent with the imperfection of our present state of being.
    James Boswell (1740–1795)