ApsaraDB RDS for MySQL supports cross-zone migration of proxy nodes within the same region. Migrating proxy nodes to the zone of the primary RDS instance reduces cross-zone write latency and avoids write performance degradation caused by inter-zone traffic between the proxy and the primary.
Prerequisites
Before you begin, make sure that:
The RDS instance meets all of the following conditions:
Engine: MySQL
Edition: RDS High-availability Edition or RDS Cluster Edition
Storage: cloud disks
Database proxy: enabled
Instance state: Running — including the primary instance, all read-only instances, and the proxy node
The instance uses virtual private cloud (VPC) endpoints. Cross-zone migration is not supported for classic network database proxies. For details, see View and manage instance endpoints and ports.
If the proxy node and the primary RDS instance are in different zones and you connect through a proxy endpoint, write performance decreases. Set the same VPC and vSwitch for both to avoid this.
Billing
Cross-zone migration is free of charge.
Potential impacts
Review the following impacts before migrating.
Transient connection interruption
Cross-zone migration causes a transient connection interruption of approximately 30 seconds. To minimize disruption:
Connect your application using an endpoint that is not affected by the migration:
RDS High-availability Edition: the primary RDS instance endpoint or a read-only RDS instance endpoint
RDS Cluster Edition: the read/write endpoint, read-only endpoint, or direct node connection endpoint
Schedule the migration during off-peak hours.
Make sure your application has an automatic reconnection mechanism. If it does not, manually reconnect after the migration completes.
Virtual IP address changes
Cross-zone migration changes the virtual IP addresses (VIPs) bound to your instance endpoints. Connect your application using endpoints rather than IP addresses so it automatically resolves the new VIP after migration.
After migration, immediately clear cached DNS records on the database client. When VIPs change, DNS propagation takes time — if the client still resolves the old VIP, connections fail until the cache expires. For clients running on a Java Virtual Machine (JVM), set the time-to-live (TTL) in the JVM configuration to 60 seconds or less so the client re-queries DNS promptly after a VIP change. For details, see Class InetAddress.
Nearest access
Cross-zone migration may invalidate the nearest access configuration. After migration, the new zone is accessible by default; the original zone is no longer accessible. If a proxy endpoint zone differs from the new default zone, nearest access to that zone fails.
The following table shows example scenarios.
| Scenario | Original proxy node zone | Proxy endpoint | Original nearest access | New proxy node zone | New default zone | New proxy endpoint zone | New nearest access |
|---|---|---|---|---|---|---|---|
Scenario 1: Zone A+Zone B → Zone A+Zone C | Zone A | Proxy endpoint a | Zone A | Zone A | Zone A | Zone A | Zone A |
| Zone C | Invalid | ||||||
| Zone B | Proxy endpoint b | Zone B | Zone C | Zone C | Zone C | Zone C | |
| Zone D | Invalid | ||||||
Scenario 2: Zone A+Zone B → Zone C+Zone D | Zone A | Proxy endpoint a | Zone A | Zone C | Zone C | Zone C | Zone C |
| Zone E | Invalid | ||||||
| Zone B | Proxy endpoint b | Zone B | Zone D | Zone D | Zone D | Zone D | |
| Zone E | Invalid |
Insufficient resources
If the destination zone has insufficient resources, the migration may fail.
Migrate proxy nodes
Log on to the ApsaraDB RDS console. On the Instances page, select the region where your instance resides, find the instance, and click the instance ID.
In the left-side navigation pane, click Database Proxy to view the basic information about your database proxy.
Click Cross-zone Migration.
NoteIf Cross-zone Migration is not displayed, check that your instance meets all prerequisites.
In the Cross-zone Migration of Database Proxy dialog box, review the zone and network information for the primary RDS instance and the database proxy. Set Destination Zone, Destination vSwitch, and Change Time, then click OK.
ImportantYou cannot change the type or specifications of the database proxy during the migration.
Review the listed impacts and click OK to confirm.
API reference
| Operation | Description |
|---|---|
| ModifyDBProxyInstance | Migrates proxy nodes to a destination zone by specifying vSwitchIds |
FAQ
Does cross-zone migration affect my application if I am not using a proxy endpoint?
No. The migration only affects applications connected through a proxy endpoint. If you connect through the primary RDS instance endpoint or a read-only RDS instance endpoint (RDS High-availability Edition), or through the read/write endpoint, read-only endpoint, or direct node connection endpoint (RDS Cluster Edition), your workloads are unaffected.
How long does the connection interruption last?
The transient connection lasts approximately 30 seconds, though the actual duration may vary based on your business. Schedule the migration during off-peak hours and use an unaffected endpoint type to minimize impact.