© Subhashini Chellappan and Dharanitharan Ganesan 2020
S. Chellappan, D. GanesanMongoDB Recipeshttps://doi.org/10.1007/978-1-4842-4891-1_5

5. Replication and Sharding

Subhashini Chellappan1  and Dharanitharan Ganesan2
(1)
Bangalore, India
(2)
Krishnagiri, Tamil Nadu, India
 
In Chapter 4, we discussed various indexes in MongoDB. In this chapter, we cover the following topics:
  • Replication.

  • Sharding.

Replication

Replication is the process of creating and managing a duplicate version of a database across servers to provide redundancy and increase availability of data.

In MongoDB, replication is achieved with the help of a replica set, a group of mongod instances that maintain the same data set. A replica set contains one primary node that is responsible for all ...

Get MongoDB Recipes: With Data Modeling and Query Building Strategies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.