Consistent hashing is a technique used for distributing keys uniformly across a cluster of nodes, minimizing the number of keys that need to be moved when nodes are added or removed. Steps include hashing keys and nodes using a hash function, placing them on a circular space or ring, and assigning keys to the nearest node in a clockwise direction. Virtual nodes help with load balancing by mapping physical nodes to multiple positions on the ring. This makes the technique scalable, load-balanced, and fault-tolerant, though it relies heavily on the quality of the hash function used.

5m read timeFrom newsletter.systemdesigncodex.com
Post cover image
Table of contents
📣 Fix Code Review Anti-Patterns & Cut Bugs in Half with CodeRabbit (Sponsored)STEP 1STEP 2STEP 3Virtual Nodes in Consistent HashingAdvantages of Consistent HashingDisadvantages of Consistent HashingUse CasesShoutout

Sort: