3

In a 6 nodes cluster with 3 master nodes and 3 replicas.

(you can find more detail on 18 minutes in this video)

Every node in a Redis Cluster is responsible for a subset of the hash slots, so for example

  Node A contains hash slots from 0 to 5500.
  Node B contains hash slots from 5501 to 11000.
  Node C contains hash slots from 11001 to 16383.

So far so good but when trying to get connected to redis cluster and get a value from a key the first request goes to cluster it responses back with which node has the requested hash slot and in the second run the value is get from the key in the calculated hash slot

enter image description here

so here we have a latency (you can find more detail on 18 minutes in this video) . but if i could use in memory cache for the nodes and hash slot there wont be this round trip.

but i don't know how StackExchange.Redis works

  • does StackExchange.Redis internally cache the nodes and hash slots?

  • do i have to write this part myself? i can't find any api on S.re to find the node after first call.

  • should i calculated hashslot and directly connect to the node containing the key for optimization?

  • how to connect to redis cluster? should all 6 nodes be presented is multiplexer?

    var conn = ConnectionMultiplexer.Connect("master1,master2,master3,replica1,replica2,replica3,allowAdmin=true");
    
Amir Jalali
  • 3,132
  • 4
  • 33
  • 46

0 Answers0