Data Durability in Replica Sets
Explore how MongoDB replica sets protect your data by maintaining durability and availability when nodes fail. This lesson guides you through creating replica sets, managing secondary nodes, and verifying no data loss occurs during node failures.
Now that you are clear on how replication works and how it is implemented let’s look into some other details.
In one of the previous lessons, what happens when a primary node fails.
However, what happens if one of the secondary nodes is killed?
We learned previously that the goal of replication is to ensure that no data is lost if a server fails. Hence, the data is still available even if a secondary node is killed off.
Implementation
Now, let’s create a replica set, kill a secondary node, and then look at its impact on the data stored in the database.
Follow the steps below:
Creating a replica set
As in the previous lesson, the three mongod instances are initiated first.
The three ...