ApsaraDB for Redis supports automatic failovers from the master node to the replica node. You can also manually switch workloads from the master node to the replica node. This allows you to perform real-time disaster recovery drills. You can also switch the node roles of the instance that is deployed across multiple zones based on your business deployment. This way, your applications can connect to the nearest nodes.
Prerequisites
The instance is of Community Edition or Enhanced Edition (Performance-enhanced instances and Hybrid-storage instances)
Switchover impact
- After switchover of master and replica nodes, the data nodes may experience transient connection errors and a read-only state for seconds. Make sure that your applications are configured to automatically reconnect to the instance.
- After an instance enters the Switching state, you cannot manage this instance. For example, you cannot modify the instance configurations or migrate the instance to another zone.
Scenario
In this scenario, the ECS instance where the application is deployed resides in Zone B. The master node of the ApsaraDB for Redis instance is deployed in Zone A. The ECS instance needs to connect to the master node across zones. This increases the network latency and may affect the performance of the ApsaraDB for Redis instance and your business operation.

To optimize the architecture for deploying cloud resources, you can switch the roles of nodes. In this example, you can change the role of the node in Zone B to a master node. Only the node roles are changed. The ECS and ApsaraDB for Redis instances can be connected in the same zone without changing the actual zones where the ApsaraDB for Redis instance is deployed and the instance ID. This minimizes network latency.