PolarDB clusters support the following types of endpoints: primary endpoint, cluster endpoint (also known as the default cluster endpoint), and custom endpoint. Both cluster endpoints and custom endpoints are provided by PolarProxy. Requests to cluster endpoints and custom endpoints are processed by PolarProxy. Requests to primary endpoints are not processed by PolarProxy. You can use these types of endpoints of a PolarDB cluster to connect to a PolarDB cluster. We recommend that you use the default cluster endpoint. This topic describes the functions and differences of these types of endpoints.
Comparison between cluster endpoints and primary endpoints
Endpoint type | Description | Scenario | Supported network type |
Default cluster endpoint (recommended) | Each PolarDB cluster supports only a single default cluster endpoint. The default cluster endpoint is provided by PolarProxy. The default cluster endpoint supports automatic read/write splitting. Write requests are routed to the primary node and read requests are routed to read-only nodes. For more information about PolarProxy, see PolarProxy. | Businesses that require read/write splitting and real-time business scaling by adding read-only nodes. |
|
Custom endpoint | You can create up to six custom endpoints for a cluster. The custom endpoints are provided by the PolarProxy.
Note You can associate only one node to a PolarDB custom endpoint. If the only node becomes faulty, the endpoint may be unavailable for up to 1 hour. We recommend that you associate more than one node with the cluster endpoint in production environments. | You can use custom endpoints to isolate the accesses from different businesses to cluster nodes. As shown in the preceding figure, exceptions in Read-only node 5 affects only Business Z. You can set the read/write mode to Read Only mode to support only read-only services. | |
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 | Scenarios |
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/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.
For information about how to configure the read/write mode for a cluster endpoint, see Configure PolarProxy.
Item | Read/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:
| Only the following configuration is supported:
Note In read-only mode:
|
Load Balancing Policy | Active Request-based Load Balancing is supported. For more information, see Load balancing policies. | Connections-based Load Balancing and Active Request-based Load Balancing are supported. For more information, see Load balancing policies. |
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 Transaction splitting. Note This configuration is supported only if Consistency Level is set to 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 the client to only a single read-only node. The total number of available connections is equal to the sum of connections to all read-only nodes. |
Security Protection | Supported. For more information, see Overload protection. | Not supported. |