This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Replica Set High Availability”.
1. Replica sets provide high availability using automatic ________
a) failover
b) replication
c) failure
d) all of the mentioned
View Answer
Explanation: Failover, in most situations does not require manual intervention.
2. Point out the wrong statement.
a) When the primary rejoins the set as a secondary, it reverts, or “rolls back,” its write operations to maintain database consistency with the other members
b) A rollback is necessary only if the primary had accepted write operations that the secondaries had not successfully replicated before the primary stepped down
c) MongoDB attempts for rollbacks, which should be rare
d) None of the mentioned
View Answer
Explanation: When a rollback does occur, it is often the result of a network partition.
3. Failover allows a ________ member to become primary if primary is unavailable.
a) Hidden
b) Primary
c) ViewState
d) Secondary
View Answer
Explanation: Replica set members keep the same data set but are otherwise independent.
4. Sometimes the failover process may require a ____________ during operation.
a) savepoint
b) rollback
c) commit
d) none of the mentioned
View Answer
Explanation: A rollback reverts write operations on a former primary when the member rejoins its replica set after a failover.
5. Point out the correct statement.
a) A rollback does not occur if the write operations replicate to another member of the replica set before the primary steps down
b) Secondaries that can not keep up with the throughput of operations on the former primary, decrease the size and impact of the rollback
c) Fault tolerance is an effect of replica set size, but the relationship is not direct
d) None of the mentioned
View Answer
Explanation: When a rollback does occur, administrators must decide whether to apply or ignore the rollback data.
6. MongoDB writes the rollback data to BSON files in the rollback/ folder under the database’s ________ directory.
a) dbPath
b) logPath
c) dataPath
d) all of the mentioned
View Answer
Explanation: The storage.dbPath setting is available only for mongod.
7. The names of rollback files have the following form.
a) <database>.<collection>.<timestamp>.bson.
b) <database>.<collection>.<tp>.bson.
c) <database>.<collection>.<timestamp>.json.
d) None of the mentioned
View Answer
Explanation: Administrators must apply rollback data manually after the member completes the rollback and returns to secondary status.
8. _________ is used to read the contents of the rollback files.
a) bsondumpdata
b) bsondp
c) bsondump
d) none of the mentioned
View Answer
Explanation: The bsondump converts BSON files into human-readable formats, including JSON.
9. Use ______ to apply the changes to the new primary after rollback.
a) mongostore
b) mongorestore
c) restore
d) none of the mentioned
View Answer
Explanation: The mongorestore program writes data from a binary database dump created by mongodump to a MongoDB instance.
10. mongorestore recreates indexes recorded by _____________
a) bsondump
b) mongodump
c) mongostore
d) all of the mentioned
View Answer
Explanation: The data format used by mongodump from version 2.2 or later is incompatible with earlier versions of mongod.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Apply for Programming Internship
- Check Information Technology Books
- Practice Programming MCQs
- Check MongoDB Books