This topic introduces the dedicated proxy feature of ApsaraDB RDS for MySQL.
A dedicated proxy resides between your database system and your application. It receives requests from your application and then routes the requests to the primary and read-only RDS instances of your database system. The dedicated proxy is easy to use and maintain, and provides high availability and high performance. In addition, the dedicated proxy provides advanced features, such as automatic read/write splitting, transaction splitting, and connection pool.
- A large number of read-only RDS instances are 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 excessively large number of connections.
- Most of your workloads require short-lived connections.
Comparison between dedicated proxy and shared proxy
ApsaraDB RDS for MySQL provides two types of proxies: dedicated proxies and shared proxies.
A shared proxy is also called a multi-tenant proxy. A shared proxy allows the database systems of different users to share proxy computing resources. In this case, these database systems may compete for proxy computing resources. This decreases the stability of the shared proxy. In addition, a shared proxy does not support the advanced features that are provided by the dedicated proxy. These advanced features include connection pool, SSL encryption, and transaction splitting. However, a shared proxy supports read/write splitting. The network type of a read/write splitting endpoint changes with the network type of the primary RDS instance. For more information, see Change the network type of an ApsaraDB RDS for MySQL instance.
A dedicated proxy is also called a single-tenant proxy. A dedicated proxy allows your database system to use dedicated proxy computing resources. Therefore, a dedicated proxy has the following benefits over a shared proxy:
- The dedicated proxy provides higher stability.
- The dedicated proxy provides higher isolation.
- The dedicated proxy provides higher performance. In normal cases, each proxy instance can process up to 20,000 requests per second. A maximum of 60 proxy instances can be created for each primary RDS instance.
Note The maximum number of connections to the dedicated proxy is not limited. This number varies based on the specifications of the primary and read-only RDS instances in your database system.
- The dedicated proxy supports scaling. You can increase the number of proxy instances based on your business requirements. For more information, see Adjust the number of dedicated proxies on an ApsaraDB RDS for MySQL instance.
- The dedicated proxy supports performance monitoring. You can adjust the number of proxy instances based on the monitoring data and your business planning. For more information, see View the monitoring data of dedicated proxies on an ApsaraDB RDS for MySQL instance.
- If you change the network type of a primary RDS instance, the network type of the read/write splitting endpoint remains unchanged. For more information, see Change the network type of an ApsaraDB RDS for MySQL instance and What are proxy terminals.
- A unified proxy endpoint is used to connect your application to your database system. You do not need to frequently update the endpoint configuration on your application. This reduces maintenance costs. For more information, see Manage the dedicated proxy endpoints of an ApsaraDB RDS for MySQL instance. The proxy endpoint remains connected unless you release the enabled proxy instances. 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 proxy endpoint remains connected.
- The dedicated proxy supports automatic read/write splitting. This reduces maintenance costs. For more information, see Enable the read/write splitting feature for an ApsaraDB RDS for MySQL instance. In normal cases, to implement read/write splitting, you must manually add the endpoints of the primary and read-only RDS instances to your application. This applies if the read-only RDS instances are available. If you enable the dedicated proxy feature, you need to add only a unified proxy endpoint to your application. This way, all the requests from your application are sent to the proxy endpoint. Then, the 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 update the configuration data on your application even if you create more read-only RDS instances or if you delete existing read-only RDS instances.
- The dedicated proxy provides more advanced features, such as connection pool and transaction splitting. For more information, see Set the connection pool type of an ApsaraDB RDS for MySQL instance and Enable the transaction splitting feature for an ApsaraDB RDS for MySQL instance.