Takes a key and returns the part of the key on which we hash to determine the server on which it will be located.
Takes a key and returns the part of the key on which we hash to determine the server on which it will be located. If it returns None then we hash on the whole key, otherwise we hash only on the returned part.
(Since version ) see corresponding Javadoc for more information.
Consistent hashing distributes keys across multiple servers. But there are situations like sorting or computing set intersections or operations like rpoplpush in redis that require all keys to be collocated on the same server.
One of the techniques that redis encourages for such forced key locality is called key tagging. See Redis Cluster data sharding for reference.
(...) but the gist is that if there is a substring between {} brackets in a key, only what is inside the string is hashed, so for example this{foo}key and another{foo}key are guaranteed to be in the same hash slot, and can be used together in a command with multiple keys as arguments.