This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Sharding Mechanics”.
1. The _________ process is responsible for redistributing the chunks of a sharded collection evenly among the shards for every sharded collection.
a) Balancer
b) Sharder
c) Replicator
d) All of the mentioned
View Answer
Explanation: By default, the balancer process is always enabled.
2. Point out the correct statement.
a) Splitting is the process MongoDB uses to distribute data of a sharded collection evenly across a sharded cluster
b) Any mongos instance in the cluster can start a balancing round
c) When a shard has too many of a sharded collection’s chunks compared to other shards, MongoDB splits balances the chunks across the shards
d) All of the mentioned
View Answer
Explanation: When a balancer process is active, the responsible mongos acquires a “lock” by modifying a document in the lock collection in the Config Database.
3. Use _______ migration to distribute data during bulk inserts.
a) automatic
b) manual
c) temporary
d) all of the mentioned
View Answer
Explanation: Shard keys are immutable and cannot be changed after insertion.
4. The balancer process sends the _______ command to the source shard.
a) moveChunkShard
b) migChunk
c) moveChunk
d) all of the mentioned
View Answer
Explanation: The source starts the move with an internal moveChunk command.
5. Point out the wrong statement.
a) When fully synchronized, the destination shard connects to the config database and updates the cluster metadata with the new location for the chunk
b) The destination shard builds any indexes required by the source that do not exist on the destination
c) The destination shard begins requesting documents in the chunk and starts receiving copies of the data
d) None of the mentioned
View Answer
Explanation: After the destination shard completes the update of the metadata, and once there are no open cursors on the chunk, the source shard deletes its copy of the documents.
6. The source shard is responsible for incoming ______ operations for the chunk.
a) read
b) write
c) read-write
d) all of the mentioned
View Answer
Explanation: During the migration process, operations to the chunk route to the source shard.
7. ________ can alter the behavior so that the delete phase of the current migration blocks the start of the next chunk migration.
a) _waitForUpdate
b) _waitForDelete
c) _waitForInsert
d) All of the mentioned
View Answer
Explanation: The _waitForDelete is generally for internal testing purposes.
8. The default value _________ becomes true for all chunk migrations.
a) secThrottle
b) secondaryThrottle
c) primaryThrottle
d) all of the mentioned
View Answer
Explanation: The new writeConcern field in the balancer configuration document allows you to specify a write concern semantics the _secondaryThrottle option.
9. You can set the _________ option on the balancer configuration to set different write concern semantics.
a) writeConcern
b) updateConcern
c) readConcern
d) all of the mentioned
View Answer
Explanation: By default, each document operation during chunk migration propagates to at least one secondary before the balancer proceeds with the next document
10. With __________ enabled, the source shard archives the documents in the migrated chunks in a directory named after the collection namespace.
a) sharding.archiveChunks
b) sharding.archiveMovedChunks
c) shard.archiveMovedChunks
d) none of the mentioned
View Answer
Explanation: Starting in MongoDB 2.6, sharding.archiveMovedChunks is enabled by default.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Apply for Programming Internship
- Practice Programming MCQs
- Check MongoDB Books
- Check Information Technology Books