PolarProxy serves as a proxy between the database and the application in a PolarDB cluster. It receives and routes all requests from the application. PolarProxy supports advanced features, such as read/write splitting, transaction splitting, connection pool, and overload protection. PolarProxy is easy to use and maintain, and provides high-availability and high-performance services. You can connect to PolarDB cluster endpoints to use the features of PolarProxy.
Architecture

A PolarDB cluster of Cluster Edition and X-Engine Edition consists of a primary node and up to 15 read-only nodes. By default, PolarDB provides two types of endpoints: the primary endpoint and cluster endpoints. The cluster endpoints are provided by PolarDB PolarProxy. The cluster endpoint can be in read and write (automatic read/write splitting) or read-only mode.
PolarProxy Enterprise Editions
- Standard Enterprise Edition is used by the PolarDB cluster of the General-purpose type. This edition shares CPU physical resources, which are one sixth of the total number of CPU cores among nodes in the PolarDB for MySQL cluster.
- Dedicated Enterprise Edition is used by the PolarDB cluster of the Dedicated type. This edition provides better stability and exclusively uses allocated CPU resources, which are one fourth of the total number of CPU cores among nodes in the PolarDB for MySQL cluster.
Item | Standard Enterprise Edition | Dedicated Enterprise Edition |
---|---|---|
Billing method | Currently free of charge. In the future, when to charge the fees is to be determined. Note You are charged for PolarProxy of Serverless clusters. For more information, see Billing of serverless clusters. | |
Resource type | Shared CPU physical resources with smart elastic scalability within seconds are provided based on business loads. | Exclusive use of physical resources with better performance stability provided. |
Architecture | High-availability redundant architecture | |
Cluster specifications | Minimum specifications: 2 cores. | |
Performance | Compared with previous editions, the maximum IOPS of cluster storage is increased by 50%. For more information about the maximum IOPS of different cluster specifications, see Specifications of compute nodes. | |
Read-only node specifications | The configurations are not necessarily consistent between the read-only nodes and the primary nodes. You can downgrade configurations based on business loads to save costs. | |
Number of read-only nodes | Up to 15 read-only nodes. | |
Network information | One primary endpoint and seven cluster endpoints. | |
Failover with hot standby | Connection and transaction not interrupted and brief block of 5 to 10 seconds. | |
Consistency |
| |
Connection pool | Supported. | |
Transaction splitting | Supported. | |
Interruption protection (connection retention) | Supported. | |
Data masking (for security) | Supported. | |
Business stability during configuration change | Supported. | |
Multi-master Cluster (Database/Table) | Supported. | |
Compute node scale-out within seconds | Supported. | Exclusive use of resources to ensure sufficient resources. |
Proxy throttling protection (available soon) | Supported. |
Billing
Database Category | Purchase type | Billing policy |
---|---|---|
Single Node Edition | PolarProxy Enterprise Edition is not supported regardless of existing or newly purchased instances. | |
Cluster Edition and X-Engine Edition | Newly purchased cluster | As of December 9, 2021, newly purchased clusters only support PolarProxy Enterprise Edition. |
Existing pay-as-you-go cluster | For existing subscription clusters, PolarProxy is switched to PolarProxy Enterprise Edition automatically on December 9, 2021. | |
Existing subscription cluster | For existing subscription clusters, PolarProxy is switched to PolarProxy Enterprise Edition automatically on December 9, 2021. |
Limits
Only clusters of PolarDB Cluster Edition and X-Engine Edition support cluster endpoints and PolarProxy. Clusters of PolarDB Single Node Edition use a single-node architecture, and do not support PolarProxy and cluster endpoints.
Precautions
- PolarProxy does not support compression protocols for the default and custom cluster endpoints.
- If you do not enable the transaction splitting feature after cluster endpoints are used, all the requests in a transaction are forwarded to the primary node.
- When you execute the
SHOW PROCESSLIST
statement after cluster endpoints are used, the system returns the results of all the nodes. - If you execute multi-statement or call stored procedures, all subsequent requests for the current connection are forwarded to the primary node. For more information, see Multi-Statement. To use the read/write splitting feature, you must close the current connection and reconnect to the cluster.
- The maximum number of connections to a PolarDB cluster endpoint depends on the specifications of compute nodes in backend databases. For a cluster endpoint that supports read/write splitting, an application establishes a connection to each compute node in the backend database. Therefore, the maximum number of connections that an application can use is the maximum number of connections of a single compute node. For a cluster endpoint that is in read-only mode, an application connection only establishes a connection to one compute node in the backend database. The maximum number of connections that an application can use is the sum of the maximum numbers of connections for all read-only nodes. For a cluster endpoint that is in read-only mode, you can use the Transaction-level connection pools feature to increase the maximum number of connections that an application can use.
- If a session that supports read/write splitting is created after you add or restart a read-only node, read requests are forwarded to the read-only node. If a session that supports read/write splitting is created before you add or restart a read-only node, read requests are not forwarded to the read-only node. To forward these read requests to the read-only node, you must close the connection and reconnect to the cluster. For example, you can restart your application to establish a new connection.
- Do not modify environment variables when you call stored procedures or execute multi-statement, such as
set names utf8mb4;select * from t1;
. Otherwise, the data read from the primary node and read-only nodes is inconsistent. - To prevent the application connection pool from being hung due to packet loss caused by network issues or other unexpected scenarios when you use the application connection pool to connect to a URL, we recommend that you add the
connectTimeout
andsocketTimeout
parameters to the URL. For more information about the parameters, see Parameters. Example:java url: jdbc:mysql://ip:port/db?connectTimeout=60000&socketTimeout=300000;
Related API operations
Operation | Description |
---|---|
CreateDBEndpointAddress | Creates a public endpoint for a specified PolarDB cluster. |
CreateDBClusterEndpoint | Creates a custom cluster endpoint for a specified PolarDB cluster. |
DescribeDBClusterEndpoints | Queries the information about the endpoints of a specified PolarDB cluster. |
ModifyDBClusterEndpoint | Modifies the configuration of a cluster endpoint for a specified PolarDB cluster. |
ModifyDBEndpointAddress | Modifies the endpoints such as custom cluster endpoints of a specified PolarDB cluster. |
DeleteDBEndpointAddress | Deletes a cluster endpoint of a specified PolarDB cluster. This operation cannot be used to delete private custom cluster endpoints. |
DeleteDBClusterEndpoint | Deletes a custom cluster endpoint of a specified PolarDB cluster. |