DEV Community

Harishma
Harishma

Posted on

Sharding vs Partitioning

Hello guys... A small read for you

Imagine there is a giant cake πŸŽ‚ (data), if you cut the giant cake and keep each piece 🍰 in separate plates (separate database in separate server) -- this is Sharding

If you just cut the giant cake (data) and keep the pieces 🍰🍰 (tables) in same plate (same database in same server) -- this is Partitioning

Both involves dividing data.

In Sharding, as data can be distributed across multiple servers, you can add more servers (horizontal scaling). Thus improves scalability.

Partitioning is dividing tables within same database and dividing tables improves query performance as less data in table means easy to find the information :)

Ok then, See you in next post. Until then #HappyLearning ;)

Top comments (0)