What about sharding algorithms ? How does the caller know which server to go for


#1

What about sharding algorithms ? How does the caller know which server to go for a specific key ? Like memcache uses hashing to determine which server the key resides on.


#2

You can use consistent hashing to determine the exact shrad for the key. But in case of cache server failure, consistent hashing can't alone help to recover the data. You must have replication cache servers so that disaster recovery happens from the replicated cache server data. You can google about consistent hashing. There are a lot of articles about it.


#3

Thanks Koushik. I am aware about consistent hashing. My question was more about no discussion on the topic of sharding mentioned in the problem.


#4

https://medium.com/@Pinterest_Engineering/sharding-pinterest-how-we-scaled-our-mysql-fleet-3f341e96ca6f
Please go through the link where the guys from pinterest have explained how they generate UUID which contains the shardID and localID of the table in the shard to determine which shard to go to, to read the data