Consistent Hashing
What's the best way to implement consistent hashing in a database that doesn't have this feature by default, in my setup I have a bunch of nodes in a zookeeper path and when I retrieve all the nodes i hash a key and decide which node to place a user own, should my consistent hashing algorithm exist in my application code? And how I go about remapping the keys in the db
4 Replies
If the DB doesn't do the hashing for you you'll have to do it in your application code, yeah. Most (all?) back-end languages have a way to hash text or other data types.
Yea I'm aware the issue isn't the algorithm it's how best, so if I have multiple instances of an application if I add a node I have to update hash ring on each node
Oh, I see. Totally misunderstood your question. I've not done any distributed work before as I've never made anything that required it, but shouldn't there be a master node that sends updates to all other nodes in such cases?
I did further research and Cassandra supports this by using the gossip protocol