ApsaraDB for MongoDB provides a variety of disaster recovery solutions.
Alibaba Cloud provides cloud computing services for multiple regions around the world. Each region contains multiple zones. Faults are isolated between different zones within the same region. Network latency is low between different zones within the same region.
An ApsaraDB for MongoDB single-zone instance runs on two physical servers within the same zone. All racks, air conditioners, circuits, and networks in the zone are redundant to ensure high availability. ApsaraDB for MongoDB provides service availability that goes beyond the limits of physical servers by using the asynchronous or semi synchronous replication mode and an efficient primary/secondary failover mechanism.
To provide higher availability than single-zone instances, ApsaraDB for MongoDB also supports multi-zone instances. Multi-zone instances are deployed on physical servers within different zones. When one zone fails, services can be switched over to another zone in a short period of time. The entire switchover process does not require changes to application code.
For more information about how to migrate instances to different zones within the same region, see Migrate an ApsaraDB for MongoDB instance to different zones in the same region.
Cross-region disaster recovery instances
ApsaraDB for MongoDB multi-zone instances provide disaster recovery across different zones within the same region. To improve availability, ApsaraDB for MongoDB also supports cross-region data disaster recovery. For example, you can replicate data from ApsaraDB for MongoDB Instance A in the China (Hangzhou) region to ApsaraDB for MongoDB Instance B in the China (Shanghai) region by using a data synchronization tool such as MongoShake. Instance B is a self-contained instance that has its own endpoints, account, and permissions. Instance B can be used to recover data and read data in the region where the instance resides.
For more information about how to replicate ApsaraDB for MongoDB instance data by using MongoShake, see Use MongoShake to implement one-way synchronization between ApsaraDB for MongoDB replica set instances.
Instance A serves as a primary instance, and Instance B serves as a secondary instance. If Instance A fails due to an unexpected event such as a natural disaster in the region where Instance A resides, Instance B can be used as the primary instance. Cross-region data disaster recovery is implemented by modifying database connection configurations in your application to forward requests to Instance B.
- We recommend that you deploy the same geo-disaster recovery application on Instance A and Instance B to minimize the network instability and latency associated with cross-region access.
- If Instance B is used as the primary instance, you must run the kill command to disable the MongoShake service. This way, data replication from Instance A to Instance B is stopped and possible problems are prevented.