What is a role of a primary shard in a sharded cluster?

Does the primary shard have other functions than holding all un-sharded collections?

Hi @nattawan,

The primary shard is mostly a logical designation which holds all the unsharded collection of a database. The routing table contains a mapping of databases to their primary shards for routing requests to unsharded collection.

Some processing operations related to aggregation can take place on primary shard but it can take place of any other shards as well.

For further information please refer our documentation on Primary Shard.

Thanks,
Shubham Ranjan
Curriculum Services Engineer

1 Like