Subjects Questions Quizzes Pricing
Advanced Open Pro

Cache Key Routing

A Redis client library implements consistent hashing across a 4-node Redis cluster. The ring positions (after hashing server names) are:

  • redis-1 at 1000
  • redis-2 at 3000
  • redis-3 at 6000
  • redis-4 at 9000 (ring wraps at 10000)

Where is the key user:session:42 stored if hash("user:session:42") = 4500? Where is hash("product:cache:7") = 9800 stored?

← Back to Consistent Hashing practice