Redis › Cluster Sharding & Hash Slots
What are hash slots in Redis Cluster, and how many are there in total?
BeginnerAnswer
Redis Cluster divides its entire key space into sixteen thousand three hundred and eighty four hash slots, and every key is assigned to exactly one of these slots based on a hash calculation, with each node in the cluster responsible for owning and serving a specific range of these slots.
-- Check which hash slot a key belongs to
redis-cli cluster keyslot user:123Real-world example A three node Redis Cluster might divide its sixteen thousand three hundred eighty four hash slots roughly evenly, with each node responsible for owning about five thousand four hundred slots and the keys that map to them.