MongoDB sharding is a method for distributing data across multiple servers to handle large datasets and high throughput operations. It is a key feature for horizontal scaling, allowing MongoDB to support applications with massive data growth. Sharding involves partitioning data into smaller chunks (shards) and distributing them across multiple servers or clusters. Each shard is an independent database, and collectively, they form a single logical database.
These MCQs cover fundamental and advanced concepts of MongoDB sharding, which are frequently tested in technical interviews.
1.) What is sharding in MongoDB?
2.) Which component is responsible for routing queries to the correct shard in MongoDB?
3.) What is a shard key in MongoDB?
4.) Which of the following is true about a shard in MongoDB?
5.) What is the role of config servers in MongoDB sharding?
6.) Which of the following is true about the shardCollection command?
7.) Which command is used to enable sharding for a database in MongoDB?
8.) What is a chunk in MongoDB sharding?
9.) What is the default chunk size in MongoDB?
10.) What is the purpose of the sh.moveChunk() command?