You need to enable JavaScript to run this app.
Document Database for MongoDB

Document Database for MongoDB

Copy page
Download PDF
Multi-availability zone disaster recovery solution
Feature introduction
Copy page
Download PDF
Feature introduction
Document Database for MongoDB supports setting multi-availability zone deployment when creating or restoring data to a new instance. Compared to single availability zone deployment, multi availability zone deployment has higher disaster recovery capability and can withstand server room level failures. This topic describes MongoDB's availability zone deployment methods.​
Precautions​
  • Multiple availability zone deployment is only supported in regions with 3 or more availability zone resources. Currently, only the following regions support 3 or more availability zone resources:​
  • China (Shanghai)​
  • China (Beijing)​
  • China (Guangzhou)​
  • FlexPL volumes currently support multi-AZ deployment in China (Shanghai) and single-AZ deployment in China (Beijing) and China (Guangzhou).​
  • Deployment across availability zones can improve availability, but there may be a network latency of 2 ms to 3 ms.​
Availability zone deployment method​
Document Database for MongoDB implements zone-disaster recovery through multi-availability zone deployment. Different instance types have different node deployment strategies.​
Replica set instance​
​
Deployment method​
Node deployment policy​
Multi-availability zone deployment​
One replica set instance contains three replicas, that is, three nodes by default. These three nodes are deployed in three different availability zones under the same region and exchange information with each other through the internal network. When the communication of the primary availability zone fails, the system automatically switches the traffic from the primary node to a secondary node to ensure the high availability of the entire replica set instance.​
Single availability zone deployment​
All nodes in replica set instance are deployed in the same availability zone.​
​
The availability zone deployment architecture diagram for replica set instances is shown below.​
​
Multi-availability zone deployment
Single availability zone deployment
​
​Deploying in multiple availability zones of replica set instance​​
​
Sharding cluster instance​
​
Deployment method​
Node deployment policy​
Multi-availability zone deployment​
Components of a sharding cluster instance are deployed in three different availability zones under the same region and exchange information with each other through the internal network. When the communication of the primary availability zone fails, the system automatically switches the traffic from the primary node to a secondary node to ensure the high availability of the entire sharding cluster instance.​
  • Mongos nodes: Evenly deployed across all availability zones. One sharding cluster instance contains two Mongos nodes by default, which are deployed in two different availability zones. When a third node is added, the node is deployed in the third availability zone by default, and subsequently added nodes are deployed in other availability zones in turn.​
  • Shard: The primary node of each shard is deployed in the primary availability zone by default. Secondary and hidden nodes are deployed in two different secondary availability zones. The availability zone deployment method of nodes of new shards is the same as that of nodes of existing shards.​
  • For example, the primary nodes of both shard 1 and shard 2 are deployed in the primary availability zone A, while the secondary and hidden nodes are deployed in the secondary availability zones B and C in turn. If shard 3 is added, the primary node of shard 3 is also deployed in the primary availability zone A, while its secondary and hidden nodes are deployed in the secondary availability zones B and C in turn.​
  • ConfigServer nodes: The primary node, secondary nodes, and hidden nodes of each ConfigServer are deployed in three different availability zones.​
Single availability zone deployment​
All Mongos nodes, shards, and ConfigServer nodes of one sharding cluster instance are deployed in the same availability zone.​
​
The availability zone deployment architecture diagram for sharding cluster instances is shown below.​
tip​
Each Mongos node in a MongoDB instance has the same function. To simplify the illustration, only the connection between Mongos Node 1 and the ConfigServer and Shard nodes is shown below. All other Mongos nodes connect in the same way as Mongos Node 1.​
​
Multi-availability zone deployment
Single availability zone deployment
​
​Deploying in multiple availability zones of sharding cluster instance​​
​
Relevant documents​
​
Last updated: 2026.10.13 19:46:31