Sharded Cluster Components in MongoDB (original) (raw)

Last Updated : 24 Feb, 2026

A Sharded cluster in MongoDB distributes data across multiple servers to improve performance, scalability, and reliability. It consists of shards, config servers, and mongos routers that work together to manage data and queries efficiently.

clients

1. Shards in MongoDB

Shards are individual databases that store portions of data across multiple servers.

2. Primary Shard in MongoDB

Each database in a sharded cluster is associated with a primary shard that holds unsharded collections and metadata.

3. Config Servers in MongoDB

Config servers store metadata about the sharded cluster, including shard locations, chunk information, and cluster organization.

Read/Write Operations:

4. Mongos Instances in MongoDB

Mongos acts as the router between client applications and the sharded cluster.

Responsibilities of Mongos Instances

Working of Mongos Instances

5. Routing and Query Handling

During query execution: