For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
MongoDB Branding Shape
Click here >
Docs Menu

Configure Independent Shard Scaling

For Atlas CLI commands that you use to deploy and manage Atlas clusters on the cloud, you can configure how the cluster handles resource scaling by using the --autoScalingMode option. You can use this option for the following commands to specify whether the cluster shards scale together or independently:

The --autoScalingMode option takes the following values:

Indicates that cluster nodes scale together across all shards.

atlas setup --clusterName symmetricShardCluster --provider AWS --autoScalingMode clusterWideScaling --projectId 5e2211c17a3e5a48f5497de3 --tier M10

For clusters configured with clusterWideScaling, the JSON output looks similar to the following:

Sample clusterWideScaling Output
{
"clusterType": "SHARDED",
"name": "symmetricShardCluster",
"diskSizeGB": 0,
"replicationSpecs": [
{
"id": "internalId",
"numShards": 2,
"regionConfigs": [
{
"electableSpecs": { ... },the
"readOnlySpecs": { ... },
...
}
],
"zoneName": "string"
}
],
...
}

To learn more about the output, see the getCluster endpoint. If you omit the --autoScalingMode option, the command defaults to clusterWideScaling mode.

Indicates that cluster nodes scale independently.

atlas setup --clusterName asymmetricShardCluster --provider AWS --autoScalingMode independentShardScaling --projectId 5e2211c17a3e5a48f5497de3 --tier M10

For clusters configured with independentShardScaling, the JSON output looks similar to the following:

Sample independentShardScaling Output
{
"clusterType": "SHARDED",
"name": "asymmetricShardCluster",
"replicationSpecs": [
{
"id": "externalId",
"regionConfigs": [
{
"electableSpecs": {
"diskSizeGB": 10,
...
},
"readOnlySpecs": {
"diskSizeGB": 10,
...
},
}
],
"zoneId": "string",// for GET/UPDATE
"zoneName": "string"
},
...
]
}

The JSON output includes the replicationSpecs object that describes the properties of a single shard. The replicationSpecs elements define the number of shards instead of the numShards field. The diskSizeGB field is inside each shard's replication_specs.regionConfig object. The zoneId field that identifies the zone for Global cluster is returned in the output. To learn more about the output, see the getCluster endpoint.