Loading topic
hash(key) mod N assigns keys to nodes. Then you will work out how many keys change owner when N changes, and why that makes resizing painful for a cache or sha7 min readhash(key) mod N remaps most keys when N changes. Here you build the structure that fixes this: the7 min readhashlib and binary search do, and have read the earlier chapters on the ring, clockwise lookup, and virtual nodes. By the end you will have a HashRing class with add_node, remove_node, and `g6 min readbisect and with the HashRing class built in the implementation chapter. It extends single-owner lookup so each key lives on several distinct nodes.6 min readHashRing class from the implementation chapter.7 min readhash(key) mod N remaps most keys when N changes, and be comfortable reading short Python programs.6 min read