All Products
Search
Document Center

ApsaraDB RDS:FAQ about database proxies

Last Updated:Mar 28, 2026

This topic answers common questions about the database proxy feature of ApsaraDB RDS for MySQL. If you see unexpected load distribution, connection timeouts, or data consistency issues after writes, use this FAQ to diagnose and resolve them.

Basics

What is a database proxy?

A database proxy sits between your application and your database, forwarding all requests from your application. It provides automatic read/write splitting, transaction splitting, connection pooling, and persistent connections — reducing operational overhead while improving availability and performance.

What is the difference between a general-purpose proxy and a dedicated proxy?

TypeCPU resourcesBillingMax specification
General-purposeSharedFree16 CPU cores across 8 proxy nodes
DedicatedExclusivePay-as-you-go64 CPU cores across 32 proxy nodes

Dedicated proxies deliver more stable performance because they exclusively occupy physical CPU resources.

For details, see Database proxy types, Relationship between the number of database proxies and the database proxy specification, and Billing rules for the database proxy feature.

Does a database proxy consume the QPS or TPS of my primary RDS instance?

No.

Is a database proxy endpoint the same as a regular endpoint?

No. A regular endpoint forwards all requests directly to the RDS instance. A database proxy endpoint routes write requests to the primary RDS instance and read requests to read-only RDS instances based on SQL statement analysis, which reduces load on the primary instance.

After I enable the database proxy feature, does the system reclaim the original endpoints?

No. The original endpoints of the primary RDS instance and its read-only RDS instances remain available.

Is the internal network type of a database proxy the same as the primary RDS instance's?

Yes. Both use a virtual private cloud (VPC).

Architecture and specifications

What architecture do database proxies use? Is there a failover mechanism?

Database proxies use a high availability architecture with two primary nodes. Connections are distributed between the two nodes at a 1:1 ratio. If one node fails, the other takes over automatically, and the system triggers a restoration task on the failed node.

For deployment details, see Deployment architecture of proxy nodes.

What is the relationship between the database proxy specification and proxy node specifications?

Database proxy specification = Sum of all proxy node specifications

For example, if you deploy 2 proxy nodes in Zone A (1 CPU core each) and 2 proxy nodes in Zone B (2 CPU cores each), the database proxy specification is 1 × 2 + 2 × 2 = 6 CPU cores.

How is the number of proxy nodes calculated?

Number of proxy nodes = Database proxy specification ÷ 2 CPU cores (unit proxy specification)

For example, a 6-CPU-core database proxy has 6 ÷ 2 = 3 proxy nodes.

What are the specification limits for proxy nodes?

ConstraintDetails
Max CPU cores per nodeGeneral-purpose: 8 CPU cores. Dedicated: 16 CPU cores.
Same-zone nodesAll proxy nodes in the same zone must have the same specification.
Dual-zone, two-node deploymentBoth nodes must have the same specification.
Different-zone nodesNodes can have different specifications. For general-purpose proxies in different zones, use the same specification.

Endpoints and connections

Does the number of proxy nodes determine the number of proxy endpoints?

No. Each RDS instance with the database proxy feature enabled supports up to 7 database proxy endpoints, regardless of the number of proxy nodes. For each proxy endpoint, you can apply for one internal endpoint and one public endpoint. For details, see Create a database proxy endpoint.

Does adding more proxy endpoints improve performance?

No. Performance depends on the number of read-only instances (for RDS High-availability Edition) or secondary nodes (for RDS Cluster Edition), the number of proxy nodes, and the proxy specification:

  • To handle more read requests, add read-only instances (RDS High-availability Edition) or secondary nodes (RDS Cluster Edition).

  • To improve overall proxy performance, increase the number of proxy nodes or upgrade the proxy specification.

Is there a connection limit for database proxies?

The database proxy itself has no hard connection limit. The effective maximum depends on the specifications of your primary RDS instance and read-only RDS instances.

Are the IP addresses resolved from database proxy endpoints fixed?

No. Always connect using the proxy endpoint domain name (for example, d3pswqe3jk9xwc5d****-rw4rm.rwlb.rds.aliyuncs.com). Do not use the resolved IP address, as it can change.

How do I determine whether a session is connected through a database proxy endpoint?

Check the session ID using the Session Manager feature.

Session IDConnection type
Less than 16,777,215Connected through a regular endpoint
16,777,215 or greaterConnected through a database proxy endpoint

Can I modify a database proxy endpoint or a read/write splitting endpoint?

Yes. See Manage database proxy endpoints.

Troubleshooting connections

The following table summarizes common connection errors and how to resolve them.

SymptomCauseResolution
Timeout error when connecting through a proxy endpointThe wait_timeout value is too lowIncrease the value of wait_timeout. See Configure instance parameters.
Cannot read data that was just writtenRead request routed to a read-only instance that has not yet applied the binary logUse hint syntax /*FORCE_MASTER*/, enable transaction splitting, or set the consistency level to global consistency. See Data consistency.
Garbled characters returned on queryPrimary and read-only instances use different character setsRun the diagnostic query below to compare character sets, then align them.

Read/write splitting

Can read requests also be sent to the primary RDS instance?

Yes. Set a non-zero read weight for the primary RDS instance. For details, see Enable the database proxy feature.

Does read/write splitting support hints?

Yes. Use hint syntax to force specific statements to the primary RDS instance. For supported hint formats, see Rules of read weight allocation by the system.

I changed the read weights, but the change doesn't seem to take effect. Why?

New read weights apply only to new connections. Existing connections retain the old weights until they are re-established.

Why do the actual loads on my instances not match the configured read weights?

Two common causes:

  • Transactions: All requests inside a transaction are forwarded only to the primary RDS instance. If your workload has many transactions, enable transaction splitting to offload read-only statements within transactions.

  • Direct instance endpoints in use: If your application connects directly to the primary or read-only instance endpoints rather than through the database proxy endpoint, read weights have no effect. Switch to a database proxy endpoint.

If I disable the database proxy feature, can I still assign read weights to read-only instances?

No. Read weight assignment requires the database proxy. As an alternative, configure your application to connect to the primary instance endpoint for write traffic and to the read-only instance endpoint for read traffic.

After a read-only instance fails, does the existing connection to it automatically fail over?

No. The existing connection stays open until it times out. After the timeout, a new connection is established to a healthy read-only instance.

How do I verify that read/write splitting is working?

See Verify read/write splitting on an ApsaraDB RDS for MySQL instance.

After I add a read-only instance for read/write splitting, is historical data from the primary instance automatically synchronized?

Yes. After you enable the database proxy feature and complete the read/write splitting configuration, historical data from the primary instance is automatically synchronized to the read-only instance.

Data consistency

I wrote data but cannot read it back when querying through a database proxy endpoint. Why?

The proxy routed your read request to a read-only instance that has not yet applied the relevant binary log. To read data you just wrote, use one of the following approaches:

Important

All three approaches route more queries to the primary instance. Evaluate the capacity of your primary instance before applying them. For most use cases, using hint syntax selectively on queries that require strong consistency causes the least additional load on the primary instance.

Connection pooling

What is the difference between the database proxy connection pool and the application connection pool?

The database proxy connection pool operates independently of the client-side connection pool. If your application already manages its own connection pool, you can disable the database proxy connection pool without affecting proxy functionality.

For details, see Set the connection pool type.

Data and schema

Why are garbled characters returned when I query data?

The primary instance and read-only instances are using different character sets. Run the following statement on both to compare:

SELECT
  @@global.character_set_results,
  @@global.character_set_client,
  @@global.character_set_connection,
  @@global.character_set_server;

If the character sets differ, align them. For details, see Character set description for ApsaraDB RDS for MySQL.

Are DDL operations automatically synchronized from the primary instance to the secondary instance?

Yes. DDL operations — including creating and deleting databases and tables, changing table schemas, and changing permissions — are automatically synchronized from the primary RDS instance to the secondary RDS instance.

Zone and deployment configuration

How do I view the VPC ID and vSwitch ID of a VPC-type internal endpoint?

On the Database Proxy page of the instance, go to the Connection Information section and hover over the icon to the right of Port.

image.png

Does cross-zone migration of database proxies affect my connections?

It depends on which endpoint your application uses:

Endpoint typeImpact
Database proxy endpointAffected. A brief disconnection lasting approximately 30 seconds occurs during migration.
RDS High-availability Edition — primary or read-only instance endpointNot affected.
RDS Cluster Edition — read/write endpoint, read-only endpoint, or direct node connection endpointNot affected.

To minimize impact, use an unaffected endpoint type and schedule the migration during off-peak hours. For details, see Migrate database proxies across zones.

Does the nearest access feature still work after cross-zone migration?

It may stop working for some endpoints. After migration, the new zone becomes the default zone for nearest access. If you manually changed a proxy endpoint to a zone that differs from the new default zone, nearest access for that endpoint no longer works. The following table shows example scenarios.

ScenarioOriginal proxy node zoneProxy endpointNearest access (before)New proxy node zoneDefault endpoint zoneCustom endpoint zoneNearest access (after)
Scenario 1: Zone A+B to Zone A+CZone AProxy endpoint aZone AZone AZone AZone AZone A
Zone CInvalid
Zone BProxy endpoint bZone BZone CZone CZone CZone C
Zone DInvalid
Scenario 2: Zone A+B to Zone C+DZone AProxy endpoint aZone AZone CZone CZone CZone C
Zone EInvalid
Zone BProxy endpoint bZone BZone DZone DZone DZone D
Zone EInvalid

Can I change the zone of a proxy node when modifying the proxy node configuration?

No. To change zones, use the cross-zone migration process. See Migrate database proxies across zones.

When switching from dual-zone to single-zone deployment, I get an error about vSwitch IDs not being in the specified zone. What do I do?

Delete the database proxy endpoint in the zone you are removing before making the switch. For example, when switching from Zone 1+Zone 2 to Zone 1 only, delete the proxy endpoint in Zone 2 first. See Manage database proxy endpoints.