This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Operational Segregation”.
1. MongoDB supports tagging a range of _______ key values to associate that range with a shard or group of shards.
a) primary
b) secondary
c) shard
d) all of the mentioned
View Answer
Explanation: Those shards receive all inserts within the tagged range.
2. Point out the correct statement.
a) Shard key range tags are distinct from replica set member tags
b) Balancer does not obey tagged range associations
c) Hash-based sharding only supports tag-aware sharding on an entire collection
d) All of the mentioned
View Answer
Explanation: Tag sets let you customize write concern and read preferences for a replica set.
3. The _______ migrates chunks of documents in a sharded collection to the shards associated with a tag.
a) balancer
b) compounder
c) fixer
d) all of the mentioned
View Answer
Explanation: During balancing rounds, if the balancer detects that any chunks violate configured tags, the balancer migrates those chunks to shards associated with those tags.
4. MongoDB stores tag sets in the replica set configuration object, which is the document returned by ____________
a) rs.config()
b) rs.conf()
c) rs.confstats()
d) all of the mentioned
View Answer
Explanation: Custom read preferences and write concerns evaluate tags sets in different ways.
5. Point out the wrong statement.
a) Read preferences consider the value of a tag when selecting a member to read from
b) Shard ranges are always exclusive of the lower value and inclusive of the upper boundary
c) Write concerns do not use the value of a tag to select a member except to consider whether or not the value is unique
d) None of the mentioned
View Answer
Explanation: Shard ranges are always inclusive of the lower value and exclusive of the upper boundary.
6. By default, an application directs its ______ operations to the primary member in a replica set.
a) read
b) write
c) read and write
d) none of the mentioned
View Answer
Explanation: Read preference describes how MongoDB clients route read operations to the members of a replica set.
7. Which of the following should not be used to provide extra capacity for reads?
a) primary
b) primaryPreferred
c) secondary
d) none of the mentioned
View Answer
Explanation: Use primaryPreferred if you want an application to read from the primary under normal circumstances.
8. Read preference modes are also available to clients connecting to a sharded cluster through ______________
a) MMS
b) mongos
c) mongod
d) none of the mentioned
View Answer
Explanation: The mongos instance obeys specified read preferences when connecting to the replica set that provides each shard in the cluster.
9. All read preference modes except _______ may return stale data.
a) primary
b) primaryPreferred
c) secondary
d) none of the mentioned
View Answer
Explanation: Ensure that your application can tolerate stale data if you choose to use a non-primary mode.
10. Which of the following preference does not affect the visibility of data?
a) read
b) write
c) read and write
d) none of the mentioned
View Answer
Explanation: Regardless of write concern, other clients can see the result of the write operations before the write operation is acknowledged to the issuing client.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Apply for Programming Internship
- Check MongoDB Books
- Practice Programming MCQs
- Check Information Technology Books