MongoDB Questions and Answers – Operational Segregation

«
»

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

Answer: c
Explanation: Those shards receive all inserts within the tagged range.

advertisement

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

Answer: c
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

Answer: a
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.

advertisement
advertisement

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

Answer: b
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

Answer: c
Explanation: Shard ranges are always inclusive of the lower value and exclusive of the upper boundary.

advertisement

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

Answer: a
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

Answer: c
Explanation: Use primaryPreferred if you want an application to read from the primary under normal circumstances.

advertisement

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

Answer: b
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

Answer: a
Explanation: Ensure that your application can tolerate stale data if you choose to use a non-primary mode.

advertisement

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

Answer: a
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 Reference Books in MongoDB.

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!

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter