The endpoints of a PolarDB cluster are classified into two types: cluster endpoint and primary endpoint. To connect to a PolarDB cluster, you can use either the primary endpoint or a cluster endpoint of the PolarDB cluster. This topic describes the use scenarios of and differences between cluster endpoints and primary endpoints.
Comparison between cluster endpoints and primary endpoints

Endpoint type | Description | Scenario | Supported network type |
---|---|---|---|
Cluster endpoint (recommended) | The cluster endpoint is implemented by using PolarProxy. Cluster endpoints have the
following features:
Note PolarDB allows you to create single-node cluster endpoints. If the node that is associated
with a single-node cluster endpoint is faulty, the single-node cluster endpoint may
remain unavailable for up to 1 hour. We recommend that you do not use single-node
cluster endpoints in your production environment.
|
For example, assume that you have purchased a PolarDB cluster that contains one primary node and four read-only nodes. You want to connect Service A and Service B to this cluster. Service A is a read-only service and Service B is a read/write service. You can create cluster endpoint A that runs in read-only mode for Service A and associate cluster endpoint A with read-only node 1 and read-only node 2. Then, create cluster endpoint B that runs in read and write (automatic read/write splitting) mode for Service B and associate cluster endpoint B with read-only node 3 and read-only node 4. This way, the data of Service A is physically isolated from that of Service B. |
|
Primary endpoint | Each PolarDB cluster supports only a single primary endpoint. The primary endpoint has the following
features:
|
Scenarios that do not require read/write splitting. |
Private endpoints and public endpoints
Network type | Description | Scenario |
---|---|---|
Internal network |
|
Examples:
|
Internet |
|
For example, you can connect to your cluster by using a public endpoint to perform O&M operations. |
Read/Write modes for cluster endpoints
You can set the read/write mode to Read and Write (Automatic Read-write Splitting) or Read Only for a cluster endpoint. The following table describes the differences between cluster endpoints that use different read/write modes.
Item | Read and Write (Automatic Read-write Splitting) | Read Only |
---|---|---|
Associated nodes | Nodes can be associated with the cluster endpoint in one of the following three configurations:
Note In read and write mode:
|
Nodes can be associated with the cluster endpoint by one of the following two configurations:
Note In read-only mode:
|
Primary Node Accepts Read Requests | Supported.
For more information, see Read/Write splitting. |
This feature is used to reduce the loads on the primary node. However, the primary node that is associated with a Read Only cluster endpoint does not process read or write requests. Therefore, this feature is redundant. |
Transaction Splitting | Supported.
For more information, see Split transactions. Note This configuration is supported only if Consistency Level is Session Consistency (Medium) or Global Consistency (Strong).
|
This feature is used to reduce the loads on the primary node. However, the primary node that is associated with a Read Only cluster endpoint does not process read or write requests. Therefore, this feature is redundant. |
Consistency Level | Eventual Consistency (Weak), Session Consistency (Medium), and Global Consistency (Strong) are supported.
For more information, see Consistency levels. |
This parameter is set to Eventual Consistency (Weak). The cluster endpoint in this mode does not process write requests. |
Connection Pool | Session-level and Transaction-level connection pools are supported.
For more information, see Connection pools. Note
|
Not supported.
Note PolarDB evenly distributes requests among all read-only nodes that are associated with the
Read Only cluster endpoint. The primary node does not process requests. PolarProxy sends a
request from a client to only a single node. The total number of available connections
is equal to the total number of connections to all read-only nodes.
|
Parallel Query | Not supported. The use of parallel query adversely impacts the primary node. | Supported. For more information, see Parallel query. |