berkeli / immersive-go

Creative Commons Zero v1.0 Universal
10 stars 0 forks source link

Memcached clusters #33

Open berkeli opened 2 years ago

berkeli commented 2 years ago

Use the set and get commands again to understand the behaviour of this mcrouter configuration. How does the behaviour differ from the replicated cluster?

  1. In the case of replicated cluster we can get it from each memcached instance, all of the commands below return the same value since data is replicated:

    • printf "get mykey\r\n" | nc localhost 11211 - this is the router, returns data
    • printf "get mykey\r\n" | nc localhost 11212 - replica, returns same data
    • printf "get mykey\r\n" | nc localhost 11213 - replica, returns same data
    • printf "get mykey\r\n" | nc localhost 11214 - replica, returns same data
  2. In the case of sharded cluster we can can only get the data from the router or from the instance that stores the data, in my case:

    • printf "get mykey\r\n" | nc localhost 11211 - this is the router, returns data
    • printf "get mykey\r\n" | nc localhost 11212 - returns data, as the router stored it in this instance
    • printf "get mykey\r\n" | nc localhost 11213 - doesn't return data
    • printf "get mykey\r\n" | nc localhost 11214 - doesn't return data
sre-is-laura commented 2 years ago

yep, the cache topology tester looks right to me. good work