All Products
Search
Document Center

PolarDB:Connect to a GDN

Last Updated:Apr 24, 2024

A Global Database Network (GDN) consists of multiple PolarDB clusters that are deployed in different regions within a country. This topic describes how to view the cluster endpoints of a GDN and connect to the GDN.

Endpoints of a GDN

A GDN does not have a unified endpoint. However, each cluster in the GDN, including the primary cluster and secondary clusters, has an individual cluster endpoint. You can use the endpoint of the cluster that is deployed in the nearest region to your application to connect to the GDN. Data is synchronized from the primary cluster to all secondary clusters in a GDN. In most cases, read requests are handled in the secondary cluster in the same region and write requests are handled in the primary cluster.

For more information about the read/write splitting feature of GDN, see Cross-region read/write splitting.

1

Only the following cluster endpoints support read/write splitting:

  • Default cluster endpoint.

  • Custom cluster endpoints whose Read/Write mode is set to Read/Write (Automatic Read/Write Splitting).

    Note
    • The primary endpoint and custom cluster endpoints in Read-only mode do not support read/write splitting.

    • For more information about how to change the Read/Write mode, see Configure PolarProxy.

    • When you configure the custom cluster endpoint for a secondary cluster, we recommend that you set Primary Node Accepts Read Requests to No and Consistency Level to Eventual Consistency (Weak). This mitigates the impact of the replication latency between the primary cluster and secondary clusters on your business. For more information about how to configure a custom cluster endpoint, see Configure PolarProxy.

View cluster endpoints

  1. Log on to the PolarDB console.

  2. In the left-side navigation pane, click Global Database Network.

  3. Find the GDN that you want to manage and click the ID or name of the GDN.GDN ID/Name

    打开目标GDN

  4. In the Clusters section, find the cluster whose endpoints you want to view.

  5. In the Cluster Endpoint column, click View. In the dialog box that appears, you can view the cluster endpoints.

    1

    Note
    • You can view only the default cluster endpoint that consists of the private endpoint and public endpoint.

    • To view other endpoints, click Visit the Overview page of the cluster. For more information about how to manage endpoints, see Manage the endpoints of a cluster.

Connect to a cluster

Applications in different regions connect to a GDN by using the endpoint of the cluster that is deployed in the same region as the applications. The GDN automatically performs read/write splitting. For information about how to connect to a cluster, see Connect to a cluster.

Related API operations

Operation

Description

DescribeGlobalDatabaseNetworks

Queries details about the GDNs that belong to an account.

CreateDBClusterEndpoint

Creates a custom cluster endpoint for a PolarDB cluster.

DescribeDBClusterEndpoints

Queries details about an endpoint of a PolarDB cluster.

ModifyDBClusterEndpoint

Modifies the attributes of a custom cluster endpoint for a PolarDB cluster, such as the read/write mode and the consistency level. You can also specify whether new nodes are automatically associated with the specified cluster endpoint.

DeleteDBClusterEndpoint

Releases a custom cluster endpoint for a PolarDB cluster.