Architectural overview
A sharded cluster is comprised of the following elements:
- Two or more shards. Each shard must be a replica set.
- One or more query routers (
mongos
).mongos
provides an interface between our application and the database. - A replica set of config servers. Config servers store metadata and configuration settings for the entire cluster.

Reference: https://www.infoq.com/news/2010/08/MongoDB-1.6
Note
We can't have a shard composed of a single server.
Development, continuous deployment, and staging environments
In preproduction environments it may be an overkill to use the full set of servers, and for efficiency reasons, we may opt to use a more simplified architecture.
The simplest possible configuration that we can deploy for sharding is the following:
- One
mongos
router - One sharded replica set with one MongoDB server and two arbiters
- One replica set of config servers with one MongoDB server and two arbiters
This should be strictly used for development and testing as this architecture...