Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between consistent hashing and cone hashing?

What I know is:

  • Consistent hashing: uniform distributed storage system
  • Cone hashing: non uniform distributed storage system

I want to know:

  • How it works?
  • What is the use of it?
  • What is the difference between this two types of hashing?

I am not able to understand the difference between this two. Please someone help me with this!

like image 732
Hemanth Venkatappa Avatar asked Dec 29 '25 02:12

Hemanth Venkatappa


1 Answers

The simple difference is in its definition.

Consistent Hashing is based on division of keys based on the number of datastores it needs to be distributed to.

e.g. 1000keys to be distributed to 5 nodes means 250 keys to each node.

Cone hashing is different in a way that it distributes the keys based on an algorithm which assigns keys based on available resources rather than distribution. Node A has more storage therefore most of the keys will be distributed to it e.t.c

Simple use cases would be IMDGs or distributed caches, whereas for cone it would be where the machines are of different specs so you could distribute keys based on their specs.

like image 164
Basit Anwer Avatar answered Dec 30 '25 22:12

Basit Anwer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!