Sharding is a method of keeping the data records in multiple machines. MongoDB uses sharding to support deployments with very large data sets and high throughput operations. It is like a horizontal partition and each partition is called Shard.
MongoDB supports horizontal scaling by sharding. Theare are following components of MongoDB sharded cluster:-
* Shard: Each shard contains a subset of sharded data. Each shard can be deployed as a replica set.
* Mongos: Mongos acts as a query router. It provides an interface between client applications and the sharded cluster.
* Config servers: Config servers store metadata and configuration settings for the cluster. MongoDB 3.4, config servers must be deployed as a replica set (CSRS).