Navigation

Deploy a Sharded Cluster

Overview

To deploy your cluster as a sharded cluster, toggle Shard your cluster (M30 and up) to Yes.

Image showing sharding option

Sharded clusters support horizontal scaling and consist of shards, config servers and mongos routers:

  • Atlas deploys each shard as a three-node replica set, where each node deploys using the configured Cloud Provider & Region, Cluster Tier, and Additional Settings. Atlas deploys one mongod per shard node.

    For cross-region clusters, the number of nodes per shard is equal to the total number of electable and read-only nodes across all configured regions. Atlas distributes the shard nodes across the selected regions.

  • Atlas deploys the config servers as a three-node replica set. The config servers run on M30 cluster tiers.

    For cross-region clusters, Atlas distributes the config server replia set nodes to ensure optimal availability. For example, Atlas might deploy the config servers across three distinct availability zones and three distinct regions if supported by the selected cloud service provider and region configuration.

  • Atlas deploys one mongos router for each node in each shard. For cross-region clusters, this allows clients using a MongoDB driver to connect to the geographically “nearest” mongos.

    To calculate the number of mongos routers in a cluster, multiply the number of shards by the number of replica set nodes per shard.

You cannot convert a sharded cluster deployment to a replica set deployment.

For details on how the number of server instances affect cost, see Number of Servers.

For more information on sharded clusters, see Sharding in the MongoDB manual.

Configure the Number of Shards

This field is visible only if the deployment is a sharded cluster.

You can set the number of shards to deploy with the sharded cluster. Your cluster can have between 1 and 50 shards, inclusive.

Note

A sharded cluster with a single shard is not recommended for production environments. Single-shard sharded clusters do not provide the same high availability and horizontal scaling benefits as configurations with multiple shards.