All Products
Search
Document Center

ApsaraDB RDS:Usage notes for the database proxy feature

Last Updated:Mar 28, 2026

Before using the database proxy for ApsaraDB RDS for MySQL, review these notes to avoid unexpected behavior in your application.

Billing

  • General-purpose Edition proxies are free. Dedicated proxies, read-only instances, and primary instances are billed separately.

  • If you release the primary instance, the database proxy is automatically released and no charges apply to the dedicated proxy after release.

Connection model

The database proxy uses a 1:N connection model: when your application connects to the proxy, the proxy establishes connections to the primary instance and all configured read-only instances simultaneously.

The proxy itself does not limit the maximum number of connections — this limit is determined by the specifications of the backend database nodes. If transaction-level connection pooling is disabled, each client connection creates a corresponding connection on the primary instance and on every read-only instance. Keep the maximum connection specifications for the primary and read-only instances as consistent as possible. Otherwise, the effective connection limit for your application is set by the instance with the lowest connection limit.

The connection pool feature is enabled by default, which may cause show processlist to display idle user connections. When connected through a proxy endpoint, show processlist merges and returns results from all nodes.

Conditions that lock routing to the primary instance

Certain conditions cause the proxy to route all subsequent requests on the current connection to the primary instance, bypassing read/write splitting. To resume read/write splitting after any of the following conditions, close the current connection and establish a new one.

ConditionDescriptionHow to mitigate
Transaction splitting disabledAll transaction requests go to the primary instance.Enable transaction splitting in the proxy settings.
Multi-statement executionA multi-statement query is executed.Rewrite queries to use single statements where possible.
Stored procedure callA stored procedure is called.Reconnect after the stored procedure completes.

Read/write splitting

Read consistency for non-transactional reads is not guaranteed when using a proxy endpoint for read/write splitting. To ensure read consistency, encapsulate read requests in a transaction or use hint syntax.

When using hint statements with the MySQL command line, include the -c option. Without it, the MySQL command-line tool silently filters out the hints. For more information, see Use hint syntax.

Read-only instance operations

  • Adding or restarting a read-only instance: After you add a read-only instance to a proxy endpoint or restart a connected read-only instance, requests from both new and existing connections are routed to the new or restarted instance.

  • Removing a read-only instance: Statements running on that instance fail immediately. To take a read-only instance offline without disrupting your application, upgrade the proxy minor engine version to 2.8.41 or later and set the read/write attribute of the proxy to Read/Write before removing the instance. For upgrade instructions, see Upgrade the minor engine version of a database proxy. To configure weights, see Configure read/write attributes and read weights.

Instance switchover

If the persistent connections feature is not enabled, changing the configuration of the primary instance or a read-only instance may trigger an instance switchover. For more information about the effects of a switchover, see Effects of an instance switchover.

If the primary instance is locked, proxy instances at version 2.9.5 or later are not released — they continue to process read requests but cannot process write requests.

Limitations

AreaLimitation
ProtocolProxy endpoints do not support the compression protocol.
Parameter parityFor High-availability Edition instances, max_prepared_stmt_count must have the same value on the primary instance and all read-only instances.
VPC and vSwitchThe proxy does not support switching Virtual Private Clouds (VPCs) or vSwitches. Modifying the primary instance's VPC does not change the proxy's VPC. The proxy can still communicate with the primary instance, but the proxy endpoint becomes unreachable through the modified VPC.
CIDR formatWhen using a privileged account to configure an account's host range, the proxy supports CIDR blocks in the 10.1.2.% format. Configuring the proxy's CIDR block as 10.1.2.0/24 is not supported.
IP whitelistThe proxy shares the IP whitelist of the primary instance. Updating the primary instance's IP whitelist automatically updates the proxy's IP whitelist.

Binary logging over the proxy

In high-latency networks, subscribing to binary logging (Binlog) through a proxy endpoint can cause Binlog Dump network throughput to become a performance bottleneck, leading to replication delay in downstream systems. Pull Binlog data by configuring a direct connection to the database node in your application or service instead.

Nearest access feature

Migrating the zone may invalidate the nearest access feature for some zones. After migration, the new zone is accessible by default, and the nearest access feature for the original zone becomes invalid. If you configure the target zone of a proxy endpoint to a zone different from the default zone, the nearest access feature for that zone also becomes invalid.

The following table shows example scenarios.

ScenarioCurrent proxy instance zoneProxy endpointNearest accessTarget proxy instance zoneDefault proxy endpoint zoneTarget proxy endpoint zoneNearest access after migration
Scenario 1: Migrate from Zone A + Zone B to Zone A + Zone CZone AProxy endpoint aZone AZone AZone AZone AZone A
Zone CInvalid
Zone BProxy endpoint bZone BZone CZone CZone CZone C
Zone DInvalid
Scenario 2: Migrate from Zone A + Zone B to Zone C + Zone DZone AProxy endpoint aZone AZone CZone CZone CZone C
Zone EInvalid
Zone BProxy endpoint bZone BZone DZone DZone DZone D
Zone EInvalid

The nearest access feature is supported only for Deployment Mode 1 of dedicated proxies. If this feature is enabled and you want to switch to a general-purpose proxy or a different deployment mode, disable the nearest access feature first. For instructions, see Set up nearest access. For more information about proxy deployment architectures, see Proxy deployment architecture.