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

1

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

The following PolarProxy Enterprise Editions are available: Standard Enterprise Edition and Dedicated Enterprise Edition.
  • 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.
The following table describes the differences between the two editions.
ItemStandard Enterprise EditionDedicated 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 typeShared 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.
ArchitectureHigh-availability redundant architecture
Cluster specificationsMinimum specifications: 2 cores.
PerformanceCompared 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 specificationsThe 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 nodesUp to 15 read-only nodes.
Network informationOne primary endpoint and seven cluster endpoints.
Failover with hot standbyConnection and transaction not interrupted and brief block of 5 to 10 seconds.
Consistency
  • Eventual consistency.
  • Session consistency.
  • Global consistency.
Connection poolSupported.
Transaction splittingSupported.
Interruption protection (connection retention)Supported.
Data masking (for security)Supported.
Business stability during configuration changeSupported.
Multi-master Cluster (Database/Table)Supported.
Compute node scale-out within secondsSupported.Exclusive use of resources to ensure sufficient resources.
Proxy throttling protection (available soon)Supported.

Billing

PolarProxy Enterprise Edition is currently provided free-of-charge but may be charged in the future.
Note You are charged for PolarProxy of Serverless clusters. For more information, see Billing of serverless clusters.
The following table describes the billing policies for PolarProxy Enterprise Edition.
Database CategoryPurchase typeBilling policy
Single Node EditionPolarProxy Enterprise Edition is not supported regardless of existing or newly purchased instances.
Cluster Edition and X-Engine EditionNewly purchased clusterAs of December 9, 2021, newly purchased clusters only support PolarProxy Enterprise Edition.
Existing pay-as-you-go clusterFor existing subscription clusters, PolarProxy is switched to PolarProxy Enterprise Edition automatically on December 9, 2021.
Existing subscription clusterFor 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 and socketTimeout 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

OperationDescription
CreateDBEndpointAddressCreates a public endpoint for a specified PolarDB cluster.
CreateDBClusterEndpointCreates a custom cluster endpoint for a specified PolarDB cluster.
DescribeDBClusterEndpointsQueries the information about the endpoints of a specified PolarDB cluster.
ModifyDBClusterEndpointModifies the configuration of a cluster endpoint for a specified PolarDB cluster.
ModifyDBEndpointAddressModifies the endpoints such as custom cluster endpoints of a specified PolarDB cluster.
DeleteDBEndpointAddressDeletes a cluster endpoint of a specified PolarDB cluster. This operation cannot be used to delete private custom cluster endpoints.
DeleteDBClusterEndpointDeletes a custom cluster endpoint of a specified PolarDB cluster.