Copy the orders or divide them

Imagine a shop’s database has many orders. With replication, several servers each keep a copy of all the orders. This can let more people read the data and provide another copy if one server fails.

With sharding, the orders are split between servers. One might hold UK orders, another US orders. Each shard holds only its share, so no single server has to store and handle every order.

The extra work

Copies may briefly show different information while updates spread. Shards need a rule for finding the right server, and a report covering all orders has to gather them from every shard. Replication is not the same as a backup: an accidental deletion can spread to every copy.