This topic introduces the dedicated proxy service of ApsaraDB RDS for MySQL.

Database proxies reside between your database system and your application. They receive requests from your application and then route the requests to the primary and read-only RDS instances in your database system. Dedicated proxies are easy to use and maintain, and provide high availability and high performance. In addition, dedicated proxies provide advanced features, such as automatic read/write splitting, transaction splitting, and connection pool.

Scenarios

  • A number of read-only RDS instances must be created to implement read/write splitting within your application. This does not allow flexible scaling and requires high maintenance costs.
  • The primary RDS instance is heavily loaded due to a large number of requests that are encapsulated in transactions.
  • The primary RDS instance is heavily loaded due to an excessive number of connections.
  • Most of your workloads require short-lived connections.

Comparison between dedicated proxies and shared proxies

ApsaraDB RDS for MySQL provides two types of database proxies: dedicated proxies and shared proxies.

A shared proxy serves more than one RDS instance, and these RDS instances belong to different users. In this case, these RDS instances may compete for resources. This decreases the stability of the shared proxy service. In addition, shared proxies do not support the advanced features that are provided by dedicated proxies. These advanced features include connection pool, Secure Sockets Layer (SSL) encryption, and transaction splitting.

Dedicated proxies use independent proxy computing resources. Therefore, dedicated proxies have the following benefits over shared proxies:

  • Dedicated proxies provide higher stability.
  • Dedicated proxies provide higher isolation.
  • Dedicated proxies provide higher performance. In most cases, each dedicated proxy can process up to 20,000 requests per second.
  • Dedicated proxies support scaling. You can increase the number of dedicated proxies based on your business requirements. For more information, see Adjust the number of dedicated proxies for an ApsaraDB RDS for MySQL instance.
  • Dedicated proxies support performance monitoring. The monitoring data provides a reference for you to adjust the number of dedicated proxies. For more information, see View the monitoring data of dedicated proxies for an ApsaraDB RDS for MySQL instance.
  • A unified dedicated proxy endpoint is used to connect to all the enabled dedicated proxies. You do not need to frequently update the endpoint configuration on your application. This reduces maintenance costs. For more information, see Create a proxy endpoint for a dedicated proxy. The dedicated proxy endpoint that you are using remains connected unless you release the proxy instance. For example, you may enable the read/write splitting feature during peak hours, and then release the read-only RDS instances and disable the feature after peak hours. In these cases, you do not need to update the endpoint configuration on your application because the dedicated proxy endpoint that you are using is still connected.
  • Dedicated proxies support automatic read/write splitting. This reduces maintenance costs. For more information, see Configure read/write splitting for an ApsaraDB RDS for MySQL instance. In normal cases, after the read-only RDS instances are created, you must manually add the endpoints of the primary and read-only RDS instances to your application to implement read/write splitting. If you enable dedicated proxies, you need to add only a unified dedicated proxy endpoint to your application. This way, all the requests from your application are sent to the dedicated proxy endpoint. Then, the dedicated proxy endpoint routes read requests to the read-only RDS instances and write requests to the primary RDS instance based on the read weights of these instances. You do not need to modify the configuration data on your application even if you create more read-only RDS instances or if you delete existing read-only RDS instances.
  • Dedicated proxies support more advanced features, such as connection pool and transaction splitting. For more information, see Connection pool and Transaction splitting.
Note For new RDS instances, shared proxies are not supported due to the limits of the shared proxy service. For existing RDS instances, their shared proxies remain valid, and Alibaba Cloud continues to maintain these shared proxies. If the shared proxy service is enabled on your RDS instance, we recommend that you upgrade the instance from shared proxy to dedicated proxy. This allows you to use more advanced features. For more information, see Upgrade an ApsaraDB RDS for MySQL instance from shared proxy to dedicated proxy.