All Products
Search
Document Center

PolarDB:View or apply for an endpoint

Last Updated:Jul 14, 2026

A PolarDB cluster has three types of endpoints: primary endpoints, cluster endpoints, and custom endpoints. When you connect to a PolarDB cluster, you can use one of the three types of endpoints of the PolarDB cluster. We recommend that you use the cluster endpoint.

Endpoints

  • Centralized PolarDB for PostgreSQL cluster (Product version is Enterprise Edition or Standard Edition)

  • PolarDB for PostgreSQL distributed cluster

Type

Description

Network types

Cluster endpoint (Recommended)

When you create a centralized PolarDB for PostgreSQL cluster (where the product version is Enterprise Edition or Standard Edition), each cluster includes a default cluster endpoint. A database proxy serves this endpoint.

The 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 the database proxy, see Database proxy.

Note

PolarDB for PostgreSQL distributed clusters do not include this default cluster endpoint.

  • Private network

  • Public network

Primary endpoint

Each PolarDB cluster has a single primary endpoint with the following features:

  • It always connects to the primary node or the primary CN and supports both read and write operations.

  • If the primary node or primary CN fails, the primary endpoint automatically fails over to the new primary node or CN.

Custom endpoint

  • Centralized PolarDB for PostgreSQL cluster

    That is, the product edition is Enterprise Edition or Standard Edition for PolarDB clusters.

    • You can create up to five custom endpoints. These endpoints are also serviced by the database proxy.

    • You can configure the read/write mode and load balancing policy for a custom endpoint. It can support read/write splitting or read-only access for your applications. For more information about the configurations, see Configure PolarProxy.

    • This endpoint routes requests only to the attached read-only node.

    Note

    PolarDB allows you to create a custom endpoint that is attached to a single node. If this node fails, the endpoint may be unavailable for up to one hour. Do not use this configuration in a production environment.

  • PolarDB for PostgreSQL distributed cluster

    • You can create up to six custom endpoints.

    • A custom endpoint that connects to multiple CNs cannot be used to run DDL statements, such as creating or deleting tables and accounts. Use this endpoint for DML and DQL statements. Use the primary endpoint to run DDL statements.

Private and public endpoints

Network type

Description

Use cases

Private network

  • Private endpoints offer the best performance for PolarDB.

  • When you create a cluster, a private endpoint is generated by default. This endpoint cannot be released, but you can modify it. For more information, see Modify an endpoint.

For example:

  • An ECS instance can access the database cluster through a private endpoint if they are in the same VPC.

  • Use DMS to access the database cluster through a VPC.

Public network

  • You can apply for or release a public endpoint. For more information, see Apply for a public endpoint.

  • The public network is the Internet. When you access PolarDB over the public network, you cannot achieve optimal performance.

For example: Access the database cluster over the public network for maintenance.

View endpoints and ports

  1. Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where your cluster is located, and then click the cluster ID.

  2. You can view the endpoint and port based on your cluster type.

    Centralized PolarDB for PostgreSQL clusters

    A centralized PolarDB for PostgreSQL cluster refers to a cluster whose product edition is Enterprise Edition or Standard Edition.

    In the Database Connections section, hover over the target endpoint. A dialog box appears showing the Network Information, which includes the endpoint and port number.

    This section displays the Primary endpoint and the Cluster endpoint (Recommended). The cluster endpoint operates in Read/Write (automatic read/write splitting) mode. For each endpoint, you can view the private endpoint, public endpoint, and EndpointId. You can also click Create custom endpoint to add a new connection.

    Note

    If you previously connected to your database by using a domain name, you can click Bind Private Domain Name to retain the original database domain name after you migrate the database to the cloud. You can bind a Private only to a private endpoint. For more information, see Private domain names.

    PolarDB PostgreSQL Distributed Edition Cluster

    In the Database Connections section, hover over the target private or public endpoint. A dialog box appears, showing the endpoint and port number.

    The expanded Endpoints panel contains fields for Public Endpoint (click Apply if none is available), Private Endpoint, and EndpointId. The Create custom endpoint option is also available on the right.

Apply for a public endpoint

  1. Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select the region where your cluster is located, and then click the cluster ID.

  2. You can apply for an endpoint based on your cluster type.

    Centralized PolarDB for PostgreSQL cluster

    A centralized PolarDB for PostgreSQL cluster refers to a cluster whose product edition is Enterprise Edition or Standard Edition.

    1. On the Basic Information page, in the Database Connections section, find the desired endpoint and click Apply to the right of Public.

      Note

      You can only apply for a Public endpoint. When you create a cluster or a custom endpoint, a Private endpoint is generated by default, so you do not need to apply for one.

    2. In the dialog box that appears, set a prefix for the endpoint and click OK.

      Note

      The endpoint prefix must meet the following requirements:

      • Must be 6 to 40 characters long and contain only lowercase letters, digits, and hyphens (-).

      • Must start with a letter and end with a letter or a digit.

    PolarDB for PostgreSQL (Distributed Edition) clusters

    1. On the Basic Information page, in the Database Connections section, find the desired endpoint and click Apply to the right of Public Endpoint.

    2. In the dialog box that appears, set a prefix for the endpoint and click OK.

      Note

      The endpoint prefix must meet the following requirements:

      • Must be 6 to 40 characters long and contain only lowercase letters, digits, and hyphens (-).

      • Must start with a letter and end with a letter or a digit.

Next steps

Connect to a PolarDB for PostgreSQL cluster

Related APIs

API

Description

DescribeDBClusterEndpoints

Queries the endpoint information of a cluster.

CreateDBEndpointAddress

Creates a public endpoint for a cluster.

ModifyDBEndpointAddress

Modifies the endpoint of a cluster.

DeleteDBEndpointAddress

Deletes a public endpoint of a cluster.