Link to video

Suppose you have a large pizza that you cannot finish by yourself, you divide the pizza into small parts so that you can share it with your friends. We need friends to finish the pizza, effectively we are taking the range of the pizza and breaking it into pieces. We "partition" the pizza.

<aside> 💡 Analogous to above example, when we use a key to break our data into pieces and allocate that to different servers, it is called horizontal partitioning.

</aside>

It depends on one key that is an attribute of the data we are storing. For ex : Use location as a sharding key.

<aside> 💡 Vertical partitioning is another way to partition data which partitions data according to columns.

</aside>

Some properties of data that are important:

Some properties of sharding :

Understanding Database Sharding | DigitalOcean

This is another great blog you can read to understand sharding in more depth.