Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
Atlas
/ /

Manage Cluster Sharding

You can horizontally scale your Atlas deployment by sharding your cluster. Sharding allows you to distribute your data across multiple nodes or shards to efficiently handle growing data and workloads. To learn more, see Sharding. If your shard reaches capacity, you can configure autoscaling to independently scale your shards.

When you configure shard scaling, keep the following in mind:

  • The number of electable, read-only, and analytic nodes on all shards must be the same.

    For Global clusters, you can have a different number of nodes per zone.

  • The storage capacity on all shards must be the same.

  • The NVME tier on all shards must be the same.

  • If you enable compute auto-scaler:

    • The minimum and maximum tier applies at the cluster level.

    • The Atlas auto-scaler only allows a maximum of 2 tier gap between the shard with the highest cluster tier and the shard with the lowest cluster tier.

    Note

    You can't configure auto-scaling for each shard if the shards are on different cluster class. For example, you can't enable auto-scaling if one shard is on M30 (General) and another shard is on M40 (Low-CPU).

Independent shard scaling allows you to configure each shard separately to better meet the workload requirements of each shard. You can configure the cluster tier of each individual shard for a customized and optimized allocation of resources and cost for each shard. That is, on each shard, your electable and read-only nodes can be on a different cluster tier than analytic nodes. On AWS and Azure, you can also configure disk performance for each shard.

For example, for one shard, you can configure your electable and read-only nodes (3 nodes) on M30 and analytics nodes (1 node) on M40 while for another shard, you can configure your electable and read-only nodes (3 nodes) on M40 and analytics nodes (1 node) on M30.

You can use the Atlas Cluster Builder UI to shard your cluster. Once your cluster is sharded, you can use the latest version of the Atlas Admin API, Atlas CLI, or HashiCorp Terraform MongoDB Atlas Provider to scale each shard independently. You can't use the Atlas UI to scale each shard independently. However, you can enable compute auto-scaling in the Atlas UI for shards to scale independently.

After you scale each shard independently using the Atlas Administration API, Atlas CLI, or Terraform, you can't manage your cluster by using the Atlas Cluster Builder UI.

You can use the Atlas Administration API, Atlas CLI, or Terraform to choose a different tier per shard. Analytics Nodes can also have independently selected tiers on all shards.

When you edit a sharded cluster with multiple shard tiers from the Atlas UI, changing the tier will change the tier of all shards.

You can use the Atlas Administration API to specify different IOPS for each shard.

If your cluster is on AWS, choose between Standard IOPS and Provisioned IOPS for each shard. If a shard uses Provisioned IOPS, you can provision different IOPS for each shard. If a shard uses Standard IOPS, the Standard IOPS is tied to the storage size of the cluster.

If your cluster is on Azure in regions that support Extended Standard IOPS, you can provision different Standard IOPS for each shard. Otherwise, the Standard IOPS is tied to the storage size of the cluster's disk.

All shards in an Atlas cluster can scale uniformly to the same cluster tier. By default, sharded clusters created before Dec 9, 2024 use cluster-wide shard scaling. If you manage your cluster using Atlas Administration API, Atlas CLI, or Terraform, upgrade your Atlas Administration API, Atlas CLI, or Terraform to independently scale your shards. If you use the Atlas UI and you enabled compute autoscaling, to independently scale your shards, contact MongoDB support.

To learn more about sharding your M30 or larger cluster, see Deploy a Sharded Cluster and Modify the Number of Shards.

Back

GridFS

On this page