Skip to Content

Hashing with Redis

24 May 2026 by
Gaurav Agarwal

๐Ÿšจ โ€œRedis Cluster uses consistent hashingโ€

Thatโ€™s what most people say.


But is it really true? ๐Ÿค”

I was thinking about this recentlyโ€ฆ


In consistent hashing:

๐Ÿ‘‰ Adding a node โ†’ minimal data movement


But in Redis:

๐Ÿ‘‰ We have 16384 slots

๐Ÿ‘‰ When a new node is added

๐Ÿ‘‰ We rebalance slots across nodes


๐Ÿ’ก Which means:

๐Ÿ‘‰ A significant number of slots can move

๐Ÿ‘‰ Sometimes from multiple nodes


So the question is ๐Ÿ‘‡

โ“ Is Redis really doing consistent hashing?

โ“ Or is it just controlled sharding?


๐Ÿ’ก Reality:

Redis Cluster uses:

๐Ÿ‘‰ Hash Slots (not a ring)

๐Ÿ‘‰ CRC16(key) % 16384 โ†’ slot โ†’ node


So whatโ€™s the difference?

๐Ÿ”น Consistent Hashing โ†’ minimizes movement mathematically

๐Ÿ”น Redis Slots โ†’ controls movement operationally


๐Ÿง  Real insight:

Redis is not optimizing for:

๐Ÿ‘‰ โ€œminimum movementโ€


Itโ€™s optimizing for:

๐Ÿ‘‰ โ€œmanageable and predictable rebalancingโ€


โœ” You can move slots gradually

โœ” You can rebalance manually

โœ” No full system rehash


๐Ÿ‘‰ Thatโ€™s why Redis chose slots over a ring


๐Ÿ’ก Final thought:

๐Ÿ‘‰ Consistent hashing = elegant theory

๐Ÿ‘‰ Redis slots = practical engineering


Curious to hear your thoughts ๐Ÿ‘‡

Do you consider Redis Cluster as consistent hashing or sharding?


Want to go deeper into System Design?

๐Ÿ‘‰https://lnkd.in/gjQhR3_Y


๐Ÿ“ธ Follow on Instagram for quick tech content:

๐Ÿ‘‰https://lnkd.in/g4V2iA2G


Follow for more on AI, Java & System Design ๐Ÿš€


#SystemDesignย #Redis #ConsistentHashingย #DistributedSystems #Scalability #BackendDevelopment #Java #Developers #Tech