Recall & Review
beginner
What is the primary role of a mongos in a MongoDB sharded cluster?
The mongos acts as a query router. It directs client requests to the correct shard(s) based on the cluster's metadata, making the sharding transparent to the client.
Click to reveal answer
intermediate
How does mongos know which shard to send a query to?
Mongos uses the cluster metadata stored in the config servers to determine the shard that holds the data for the query's shard key range.
Click to reveal answer
beginner
True or False: mongos stores data itself in a sharded cluster.
False. Mongos does not store data. It only routes queries to the appropriate shards which hold the actual data.
Click to reveal answer
advanced
What happens if a mongos instance loses connection to the config servers?
Mongos cannot route queries correctly without config server metadata. It will fail to process queries until it reconnects and refreshes metadata.
Click to reveal answer
intermediate
Why might you run multiple mongos instances in a sharded cluster?
Running multiple mongos instances improves availability and load balancing for client requests, preventing a single point of failure or bottleneck.
Click to reveal answer
What is the main function of a mongos router in MongoDB?
✗ Incorrect
Mongos routes queries to the correct shard based on metadata; it does not store data or manage backups.
Where does mongos get the metadata to route queries?
✗ Incorrect
Mongos retrieves cluster metadata from the config servers to know where data is located.
If mongos loses connection to config servers, what happens?
✗ Incorrect
Without config server metadata, mongos cannot route queries correctly.
Does mongos store any data in a sharded cluster?
✗ Incorrect
Mongos only routes queries; data is stored on shards.
Why run multiple mongos instances?
✗ Incorrect
Multiple mongos instances improve availability and load balancing for query routing.
Explain how mongos routes a client query in a MongoDB sharded cluster.
Think about how mongos acts like a traffic controller.
You got /4 concepts.
Describe what happens if a mongos instance cannot access the config servers.
Consider the importance of config server metadata for routing.
You got /4 concepts.