Config database is the backbone of a sharded setup in Mongo. It stores all the metadata of the shard setup and has a dedicated mongod process running for it. When a mongos process is started we provide it with the config servers' URL. In this recipe, we will take a look at some collections in the config database and dive deep into their content and significance.
We need a sharded setup for this recipe. Refer to the recipe Starting a simple sharded environment of two shard in Chapter 1, Installing and Starting the Server for information on how to start a simple shard. Additionally, connect to the mongos process from a shell.
From the console connected to the mongos process, switch to the config database and execute the following:
mongos> use config mongos>show collections
From the list of all collections, we will visit a few. We start with the databases collection. This keeps a track of all the databases on this...