Use the set and get commands again to understand the behaviour of this mcrouter configuration. How does the behaviour differ from the replicated cluster?
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
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
Use the set and get commands again to understand the behaviour of this mcrouter configuration. How does the behaviour differ from the replicated cluster?
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 dataprintf "get mykey\r\n" | nc localhost 11212
- replica, returns same dataprintf "get mykey\r\n" | nc localhost 11213
- replica, returns same dataprintf "get mykey\r\n" | nc localhost 11214
- replica, returns same dataIn 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 dataprintf "get mykey\r\n" | nc localhost 11212
- returns data, as the router stored it in this instanceprintf "get mykey\r\n" | nc localhost 11213
- doesn't return dataprintf "get mykey\r\n" | nc localhost 11214
- doesn't return data