All Products
Search
Document Center

PolarDB:Automatically switch zones

Last Updated:Mar 30, 2026

When all compute nodes in the primary zone fail simultaneously, cross-zone automatic switchover keeps your PolarDB for MySQL Cluster Edition cluster available. The cluster detects the outage and automatically promotes secondary databases in the secondary zone to primary databases, typically in seconds.

Prerequisites

Before you begin, ensure that you have:

  • A PolarDB for MySQL Cluster Edition cluster — other editions do not support this feature

  • The hot standby cluster feature enabled for your cluster

  • A pay-as-you-go or subscription billing method

Scope and limitations

Unsupported regions

Multi-zone deployment is unavailable in the following regions: Philippines (Manila), South Korea (Seoul), China (Qingdao), China (Chengdu), China (Hohhot), and Thailand (Bangkok).

Recovery objectives in asynchronous mode

Metric Description Typical Worst case
Recovery Point Objective (RPO) Maximum data that may be lost < 100 ms < 60 seconds
Recovery Time Objective (RTO) Maximum time to restore service < 30 seconds < 30 seconds
Note: In asynchronous mode, data committed after the last synchronized redo log may be lost during a switchover. Enable semi-synchronous mode to reduce RPO and prevent data loss. See step 4 in Enable cross-zone automatic switchover.

How it works

Cross-zone automatic switchover is an automatic failover that triggers only when the primary zone becomes unavailable — not for planned maintenance. When the primary zone fails, PolarDB promotes secondary databases in the secondary zone to serve as the new primary databases, restoring cluster availability without manual intervention.

PolarDB supports two data replication modes between zones:

Mode How a transaction commits RPO Best for
Asynchronous (default) After redo logs are stored on the read/write node < 100 ms typical Workloads that tolerate minimal data loss
Semi-synchronous After redo logs are persistently stored on the cross-zone backup node Reduced; prevents data loss Workloads that require strong durability

Switching back to the original primary zone after recovery is a separate, planned operation. See Switch back to the original primary zone.

Billing

Cross-zone automatic switchover is free of charge.

Enable cross-zone automatic switchover

  1. Log on to the PolarDB console. In the left-side navigation pane, click Clusters. In the upper-left corner, select the region of your cluster. In the cluster list, find the cluster and click its ID to go to the Basic Information page.

  2. Click Enable to the right of Cross-zone Automatic Switchover.

    image

  3. In the dialog box that appears, click OK.

    After cross-zone automatic switchover is enabled, the cluster automatically switches to the secondary zone if the primary zone fails.

  4. In the dialog box, click OK. After you click OK, the cluster automatically switches to the secondary zone whenever primary-zone resources become unavailable.

  5. (Optional) Enable semi-synchronous mode to reduce RPO and prevent data loss.

    Tip: Enable semi-synchronous mode if your workload cannot tolerate data loss. In this mode, a transaction commits only after its redo logs are durably stored on the cross-zone backup node. For details, see Semisynchronous replication based on physical replication.
    1. Click Modify Data Replication Mode.

      image

    2. In the dialog box, set Cross-zone Data Replication to Semi-synchronous, then click OK.

      image

Switch back to the original primary zone

After an automatic switchover, traffic is served from the secondary zone. Because connections cross zone boundaries, network latency increases. Switch back to the original primary zone after its resources are recovered.

Two options are available:

Option vSwitch used When to use
Switch to Original Primary Zone Original vSwitch Restore the exact original configuration
Change Primary Zone Any vSwitch you select Use a different vSwitch in the original zone

Switch to original primary zone

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where the cluster resides.

  3. Find the cluster and click its ID.

  4. On the Basic Information page, click Fail Back to Original Primary Zone.

  5. In the dialog box, click OK.

Change the primary zone

To switch back using a different vSwitch, see Change the primary zone and vSwitch of a cluster.

What's next