Replication and Sharding

Replication

Sharding

To solve the problem we can split up the data based on a hashing, one that promises uniformity to determine which shard the data would be written to and read from. You can cannot change the hashing function here because the hashing determine which shard the data would be written to and changing the hashing function would change that as well. Here Consistent Hashing, when adding another shard, this would minimize the number of peieces of data that we have to migrate from other shards to the new shard, but if one of the existing database shards goes down then consistent hashing would not help. In that we need replica of the shard to get the database back up. In the end, its up to designer to find means to split up the data in different ways, put some thought to it.

back