'Does consistent hashing require each node to have a routing table?

Hi I learned that consistent hashing maps a key to somewhere in the ring, and then let the immediate clockwise node store that key's value. The advantage of consistent hashing is that we can minimize the number of rehashing if node joins and leaves.

In my opinion, there should be one primitive operation in the consistent hashing scheme: given a key, find the node's IP address that stores that key. Even though this operation is clear in our mind (just the immediate clockwise node), we still need a mechanical way to implement it.

One solution is a central table that records each node's IP address and its managing key range (then do a binary search). However, does this solution work in practice? I mean what is the number of nodes in the system? If the number is large, a node cannot possibly store the entire nodes' IP address in its memory? Or I am overreacting here because when people use consistent hashing, we usually assume that the number of nodes is below 5000? If below 5000, then a central table sounds do-able.

Another solution is similar to P2P system's Chord idea. Each node has one portion of the central table, and we trade time for space. Now we need to ask several nodes before reaching the target node that stores our key.

Is the number of nodes the critical parameter here? In P2P, my guess is the number of nodes is huge.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source