O'Reilly logo

MongoDB High Availability by Afshin Mehrabani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning about sharding

The good news is that MongoDB has come up with a clever solution to scale your database system easily. Sharding is a technique used to scale a database horizontally.

Using sharding, the entire database is divided into separate single databases on different machines. Finally, using a query router, all the separate nodes make a single logical database.

Let's look at an example of sharding. Suppose we have a database sized 1 TB. Storing such a large dataset on a single server is a big challenge, so we use sharding to divide the entire database into smaller instances called shards.

In order to reduce the size of the entire database, we divide it into databases sized 256 GB. During the sharding procedure, each part of the database ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required