If your ApsaraDB RDS for MySQL instance (MySQL 5.6 or 5.7) uses the shared database proxy for read/write splitting, upgrade to the dedicated database proxy. The shared database proxy has not received updates or maintenance since April 1, 2021 — Alibaba Cloud provides technical support only. The dedicated database proxy offers better stability, higher throughput, and scalability that the shared proxy cannot provide.
You cannot upgrade directly from a shared database proxy to a general-purpose database proxy. Upgrade to a dedicated database proxy first, then change the proxy type to general-purpose if needed. For differences between proxy types, see General-purpose proxies and dedicated database proxies.
When to upgrade
Consider upgrading if your instance experiences any of the following:
-
Connection instability: The shared proxy shares resources across instances — any instance on the same shared proxy can affect yours. The dedicated proxy gives each instance exclusive resources, removing this risk.
-
Throughput limits: Each dedicated proxy handles up to 20,000 queries per second (QPS) in online transaction processing (OLTP) scenarios (Sysbench verified). You can add more proxies to handle higher workloads.
-
Endpoint churn: The shared proxy endpoint may change, requiring application-side updates. The dedicated proxy endpoint stays valid until you explicitly release it.
-
Feature gaps: The shared proxy supports read/write splitting only. The dedicated proxy also supports short-lived connection optimization and transaction splitting.
-
Performance monitoring: The dedicated proxy supports performance monitoring. You can adjust the number of proxies based on monitoring data and your business needs. Adjustments take effect immediately.
For a full overview of the dedicated database proxy, see What are database proxies?
Upgrade promotions
When you upgrade, you receive a free trial period for the dedicated database proxy. During the trial, the default number of proxies assigned to your instance is free. Extra proxies beyond the default are charged from the moment you enable them.
The free trial period depends on your billing method:
-
Pay-as-you-go: one year.
-
Subscription: at least one year, depending on when your instance expires.
-
If you upgrade more than one year before your instance expires, the trial ends when the instance expires.
-
If you upgrade less than one year before your instance expires, the trial lasts one year.
-
Renewing your primary RDS instance does not extend the free trial period.
Important details:
-
Only proxies beyond the default count are charged. For example, if the default is 6 proxies, enabling 7 means you pay for 1 proxy.
-
If you disable the dedicated database proxy during the free trial, the trial ends immediately. Re-enabling it incurs charges.
Prerequisites
Before you begin, make sure that:
-
Your primary RDS instance and its read-only RDS instances run one of the following versions:
-
MySQL 5.7 with minor engine version 20190925 or later on RDS High-availability Edition
-
MySQL 5.6 with minor engine version 20200229 or later on RDS High-availability Edition
-
-
The shared database proxy is enabled on your primary RDS instance. Go to Database Proxy in the console to confirm.
If the upgrade fails with current db not support db proxy, upgrade the minor engine version and retry.
Billing
The system recommends a proxy count based on the combined specifications of your primary and read-only RDS instances. Fees for extra proxies are deducted hourly. For pricing details, see Billing rules for the dedicated database proxy feature.
Potential impact
During the upgrade:
-
All endpoints (primary and read-only instances) experience a connection interruption of 30–120 seconds.
-
The read/write splitting routing endpoint is unavailable for 30 seconds.
Things to check before you upgrade
Review the following before you proceed.
Connection model and specifications
After you enable the dedicated proxy, each connection is replicated to the primary and read-only instances using a 1:N model. Use the same connection specifications across all instances. If specifications differ, the lowest specification limits the total connections allowed.
If you create or restart a read-only RDS instance after enabling the proxy, only requests over new connections are routed to that instance.
Parameter consistency
Set max_prepared_stmt_count to the same value on the primary and all read-only instances.
Endpoint and DNS
After the upgrade, your endpoint stays the same but the virtual IP address (VIP) changes. Always connect using the endpoint, not the IP address.
After the upgrade, flush cached DNS records from your database client. If your application runs on a Java Virtual Machine (JVM), set the time-to-live (TTL) to 60 seconds or less so the JVM picks up the new VIP automatically. See Class InetAddress for JVM TTL configuration.
Multi-statement feature
The dedicated proxy enables the multi-statement feature at the protocol layer by default. If your application does not enable it, you will see errors when running multi-statement queries. To prevent this: add allowMultiQueries=true to your JDBC settings before you upgrade.
For the full list of usage notes, see Usage notes for the database proxy feature.
Upgrade the database proxy
-
Go to the Instances page. In the top navigation bar, select the region where your RDS instance resides. Find the instance and click its ID.
-
In the left-side navigation pane, click Database Proxy.
-
Click Upgrade to Dedicated Proxy and wait for the upgrade to complete.
What's next
-
To change the proxy type or adjust the number of proxies, see Change the proxy type and number of proxies.
-
To learn more about proxy features such as read/write splitting and transaction splitting, see What are database proxies?