MongoDB Questions and Answers – Master Slave Replication

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Master Slave Replication”.

1. Which of the following members should be hidden?
a) Delayed
b) Hidden
c) Primary
d) All of the mentioned
View Answer

Answer: a
Explanation: Use hidden members for dedicated tasks such as reporting and backups.

2. Point out the wrong statement.
a) Clients will not distribute reads with the appropriate read preference to hidden members
b) Hidden members cannot vote in replica set elections
c) If you stop a voting hidden member, ensure that the set has an active majority or the primary will step down
d) None of the mentioned
View Answer

Answer: b
Explanation: Hidden members may vote in replica set elections

3. __________ operations cannot guarantee that the data files do not change.
a) db.lockl()
b) db.synclock()
c) db.fsyncUnlock()
d) secondary
View Answer

Answer: c
Explanation: As a result, do not use these methods to ensure consistency for the purposes of creating backups.

4. _______ may block reads, including those necessary to verify authentication.
a) db.lockall()
b) db.fsyncLock()
c) db,lockreads()
d) none of the mentioned
View Answer

Answer: b
Explanation: Such reads are necessary to establish new connections to a mongod that enforces authorization checks.

advertisement
advertisement

5. Point out the correct statement.
a) In MongoDB, clients cannot see the results of writes before they are made durable
b) Users may configure read preference on a per-connection basis to prefer that the read operations return results from the secondary members
c) Clients cannot read data which may be subsequently rolled back
d) None of the mentioned
View Answer

Answer: b
Explanation: If clients configure the read preference to permit secondary reads, read operations can return data from secondary members that have not replicated more recent write operations.

6. ________ unlocks a mongod instance to allow writes and reverses the operation of a db.fsyncLock() operation.
a) db.fsyncUnlock()
b) db.fsynclock()
c) db.syncUnlock()
d) secondary
View Answer

Answer: a
Explanation: Typically you will use db.fsyncUnlock() following a database backup operation.

7. Delayed members are a ________ or a running “historical” snapshot of the data set.
a) “rolling backup”
b) “roll backup”
c) “rolling commit”
d) none of the mentioned
View Answer

Answer: a
Explanation: They may help you recover from various kinds of human error.

8. Delayed members apply operations from the _______ on a delay.
a) oplog
b) log
c) mlog
d) none of the mentioned
View Answer

Answer: a
Explanation: Always prevent applications from seeing and querying delayed members.

advertisement

9. In sharded clusters, delayed members have limited utility when the __________ is enabled.
a) Balancer
b) Collector
c) Emitter
d) None of the mentioned
View Answer

Answer: a
Explanation: Delayed members replicate chunk migrations with a delay.

10. A delayed member has its priority equal to 0 and hidden equal to ___________
a) 0
b) flase
c) true
d) all of the mentioned
View Answer

Answer: c
Explanation: When you configure a delayed member, the delay applies both to replication and to the member’s oplog.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.