All Products
Search
Document Center

PolarDB:Configure PolarProxy

Last Updated:Mar 28, 2026

PolarProxy is the built-in proxy layer for PolarDB clusters. It handles read/write splitting, transaction splitting, and read consistency — all configured through a custom cluster endpoint.

A custom cluster endpoint lets you control exactly how traffic is routed to your primary and read-only nodes, independently of the default cluster endpoint. Use it when the default endpoint's routing behavior doesn't fit your workload.

Prerequisites

Before you begin, ensure that you have:

Create a custom cluster endpoint

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where your cluster is deployed.

  3. Find the cluster and click its ID.

  4. On the Basic Information page, go to the Database Connections section and click Create Custom Cluster Endpoint.

  5. In the Create Custom Cluster Endpoint dialog box, configure the following parameters.

    Network information

    ParameterDescription
    Network InformationPolarDB provides a private endpoint for each cluster endpoint by default. To change the private endpoint or add a public endpoint, see Modify an endpoint and Apply for an endpoint.

    Cluster settings

    ParameterDescription
    Read/WriteThe read/write mode of the custom cluster endpoint. Valid values: Read-only and Read/Write (Automatic Read/Write Splitting).
    Note

    After you change the read/write mode, the new mode applies only to new connections. Existing connections continue using the previous mode.

    Endpoint NameA name for the custom cluster endpoint.

    Node settings

    ParameterDescription
    Available Nodes and Selected NodesSelect nodes to associate with this endpoint. Move nodes from the Available Nodes list to the Selected Nodes list by clicking the 1 icon.
    Note

    The Available Nodes list includes the primary node and all read-only nodes. Node selection does not affect the read/write mode — in Read/Write (Automatic Read/Write Splitting) mode, write requests always go to the primary node regardless of whether the primary node is selected. If you set Read/Write to Read-only, you cannot create an endpoint that contains only the primary node.

    Automatically Associate New NodesWhether to automatically associate newly added nodes with this endpoint.

    Load balancing settings

    ParameterDescription
    Load Balancing PolicyDetermines how read traffic is distributed across nodes. If Read/Write is Read-only, choose Connections-based Load Balancing (distributes by connection count) or Active Request-based Load Balancing (distributes by in-flight request count). If Read/Write is Read/Write (Automatic Read/Write Splitting), the policy is fixed to Active Request-based Load Balancing.
    Primary Node Accepts Read RequestsAvailable only in Read/Write (Automatic Read/Write Splitting) mode. Set to No to route all read (SELECT) traffic to read-only nodes only, reducing load on the primary node. For details, see Read/write splitting.

    Transaction splitting

    ParameterDescription
    Transaction SplittingAvailable only in Read/Write (Automatic Read/Write Splitting) mode. Specifies whether to enable the transaction splitting feature. For details, see Transaction splitting.

    Consistency settings

    ParameterDescription
    Consistency LevelControls whether reads reflect the latest writes. In Read/Write (Automatic Read/Write Splitting) mode, choose Eventual Consistency (Weak) or Session Consistency (Medium). In Read-only mode, the consistency level is fixed to Eventual Consistency (Weak). Changes to the consistency level take effect immediately on all connections. For details, see Consistency levels.

    Connection pool settings

    ParameterDescription
    Connection PoolOff (default) disables connection pooling. Transaction-level enables the transaction-level connection pool feature, which reduces high database load caused by a large number of connections. For details, see Transaction-level connection pools.
  6. Click OK.

Modify a custom cluster endpoint

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where your cluster is deployed.

  3. Find the cluster and click its ID.

  4. On the Basic Information page, go to the Database Connections section, find the endpoint you want to modify, and click Configure to the right of the endpoint name.

  5. In the Modify Endpoint Settings dialog box, update the parameters. For parameter descriptions, see Create a custom cluster endpoint.

  6. Click OK.

Release a custom cluster endpoint

Important

You can only release custom cluster endpoints. The default cluster endpoint cannot be released. After release, the endpoint cannot be restored — update your application's connection string before releasing.

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where your cluster is deployed.

  3. Find the cluster and click its ID.

  4. On the Basic Information page, go to the Database Connections section, find the endpoint you want to release, and click Release to the right of the endpoint name.

  5. In the confirmation dialog box, click OK.

API reference

OperationDescription
CreateDBClusterEndpointCreates a custom cluster endpoint for a PolarDB cluster.
DescribeDBClusterEndpointsQueries the cluster endpoints of a PolarDB cluster.
DeleteDBClusterEndpointReleases a custom cluster endpoint of a PolarDB cluster.