All Products
Search
Document Center

PolarDB:Global Database Network (GDN)

Last Updated:Nov 04, 2025

A Global Database Network (GDN) is a network of multiple PolarDB clusters distributed across different regions. In a GDN, data is synchronized across all clusters. Each cluster can handle read requests, and write requests are forwarded to the primary cluster for processing.

Introduction

A Global Database Network (GDN) consists of one primary cluster and multiple secondary clusters. The primary cluster handles write requests, while the secondary clusters are distributed across different regions to handle local read requests. Below is an example where data is synchronized across all clusters over low-latency links, forming a single logical database:

image

Data synchronization mechanism

Then GDN leverages asynchronous physical replication for cross-region data synchronization. Technologies such as parallel physical log replay help keep the replication delay between the primary and secondary clusters within 2 seconds. This synchronization method does not affect the performance or stability of the primary cluster and ensures eventual consistency of data across the globe. Each cluster in a GDN provides read and write services and supports geo-disaster recovery.

Read/write splitting and request routing

The routing of read and write requests to clusters in a GDN is determined by the database proxy configuration of each cluster. Your application does not require code changes. Simply connect to the endpoint of the appropriate cluster, and requests are automatically routed based on the following logic:

  • Write requests, such as INSERT, UPDATE, and DELETE statements, other broadcast syntax such as SET statements, and all requests within transactions are automatically forwarded to the primary node of the primary cluster for processing.

  • Read requests are routed by default to the read-only nodes of the local secondary cluster for nearest access. If session consistency is enabled, some read requests may also be routed to the primary node of the primary cluster to ensure data consistency.

GDN also provides a global domain name. This feature not only enables nearest access but also ensures the domain name remains unchanged after a primary cluster switchover.

Click to view detailed routing logic

Destination node

Forwarded requests

Forwarded only to the primary node of the primary cluster

  • All DML operations, such as INSERT, UPDATE, DELETE, and SELECT FOR UPDATE.

  • All DDL operations, such as creating, deleting, or altering tables or databases, and managing permissions.

  • All requests within transactions.

  • User-defined functions.

  • Stored procedures.

  • EXECUTE statements.

  • Multi Statements.

  • Requests that use temporary tables.

  • SELECT last_insert_id().

  • All queries and modifications to user variables.

  • SHOW PROCESSLIST.

  • KILL (the statement, not the command).

Forwarded to read-only nodes or the primary node

Note

Requests are sent to the primary node only if The Primary Node Accepts Read Requests is set to Yes in the database proxy configuration.

  • Read requests outside of transactions.

  • COM_STMT_EXECUTE commands.

Always forwarded to all nodes

  • All modifications to system variables.

  • USE commands.

  • COM_STMT_PREPARE commands.

  • Commands such as COM_CHANGE_USER, COM_QUIT, and COM_SET_OPTION.

Note

The primary node in a secondary cluster is mainly used for asynchronous data replication from the primary cluster and does not handle any read or write requests. Therefore, the primary node in the table refers to the primary node of the primary cluster, and read-only nodes refer to the read-only nodes of the secondary clusters.

Use cases

Active geo-redundancy (multi-region deployment)

You can deploy your services across multiple regions. GDN's features, such as low-latency cross-region synchronization, cross-region read/write splitting, and nearest access, ensure that applications in each region achieve database access latency of less than 2 seconds.

  • Typical industries: Gaming, cross-border e-commerce, local services (food delivery), and new retail (outlets).

  • Business architecture:

    • Applications in each region directly read from and write to the local database for optimal performance. Write requests are forwarded to the primary cluster for processing.

    • In a GDN, each cluster, including the primary and secondary clusters, provides an independent cluster endpoint. You can connect to the endpoint of the nearest cluster based on your application's region to access the database.

    • The specifications of the secondary clusters in Beijing and Shenzhen must be greater than or equal to those of the primary cluster in Hangzhou. For best results, use the same specifications.

image

Geo-disaster recovery

You can achieve cross-region high availability with GDN to improve data security and system availability. If the data center where the primary cluster is located fails, you can quickly restore your services by manually switching to a secondary cluster. GDN supports various architectures, such as a two-region three-data-center architecture.

  • Typical industries: Banking, securities, and insurance.

  • Business architecture (example: two-region three-data-center architecture):

    • The Beijing region is the primary region and uses a dual-zone deployment, covering AZ1 and AZ2.

    • The Shanghai region is the disaster recovery region and uses a single-zone deployment.

    • By default, the application performs local reads and writes on the database in AZ1 of the Beijing region. If AZ1 fails, the system first switches over to AZ2 in Beijing. If both AZ1 and AZ2 fail, the system switches over to AZ3 in Shanghai.

image
Note

A primary/secondary switchover in a GDN is typically completed in less than 5 minutes, but can take up to 10 minutes. During the switchover, a transient connection interruption of up to 160 seconds may occur. We recommend that you perform the switchover during off-peak hours and make sure that your application has a reconnection mechanism.

Benefits

  • Cross-region deployment: Extend from a single-city deployment to a multi-region deployment without changing your application code.

  • Cross-region read/write splitting and nearest access: Read requests within the GDN are sent directly to the secondary cluster in the current region. Write requests are forwarded to the primary cluster.

  • Flexible configuration: The primary and secondary clusters have independent configurations, including cluster specifications, whitelists, and parameter values.

  • Low-latency cross-region synchronization: Asynchronous physical replication, based on Redo Log, and parallel replay technologies keep the cross-region replication delay between the primary and secondary clusters to less than 2 seconds. This significantly reduces read latency for applications that access data from non-central regions.

Scope

Cluster configuration

  • Edition: Enterprise Edition, and the series must be Cluster Edition.

  • The database engine version must be one of the following:

    • MySQL 8.0.2.

    • MySQL 8.0.1 with minor engine version 8.0.1.1.17 or later.

    • MySQL 5.7 with minor engine version 5.7.1.0.21 or later.

    • MySQL 5.6 with minor engine version 5.6.1.0.32 or later.

  • Nodes: Must include at least one read-only node.

Supported regions

All regions in the Chinese mainland, China (Hong Kong), Japan (Tokyo), South Korea (Seoul), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Philippines (Manila), Thailand (Bangkok), Germany (Frankfurt), US (Silicon Valley), US (Virginia), and UK (London).

Note

You can deploy secondary clusters across borders, but you must submit a request. For more information, see Add a secondary cluster.

Feature limitations

  • Clusters in a Global Database Network (GDN) support the In-Memory Column Index (IMCI) feature. However, you must enable the loose_polar_enable_imci_with_standby cluster parameter before you can add a read-only column store node. The cluster version must also meet one of the following requirements:

    • MySQL 8.0.1 with revision version 8.0.1.1.48 or later.

    • MySQL 8.0.2 with revision version 8.0.2.2.27 or later.

  • Clusters in a GDN can be serverless clusters or clusters with defined specifications that have the serverless feature enabled. However, if the minor engine version of the primary cluster is earlier than the following versions, all clusters in the GDN must have at least one read-only node:

    • MySQL 8.0.1 with minor engine version below 8.0.1.1.42.

    • MySQL 8.0.2 with minor engine version below 8.0.2.2.23.

  • Clusters in a GDN do not support the database and table restoration feature.

Other limitations

  • A GDN consists of one primary cluster and up to four secondary clusters.

    Note

    To add more secondary clusters, go to Quota Center, find the quota item based on the quota ID polardb_mysql_gdn_region, and click Apply in the Actions column.

  • A cluster can belong to only one GDN.

  • You can only create new clusters as secondary clusters. You cannot add an existing cluster as a secondary one.

  • The primary and secondary clusters must use the same database engine version: MySQL 8.0, MySQL 5.7, or MySQL 5.6.

  • For secondary clusters in a GDN that are not serverless clusters, each compute node must have at least 4 CPU cores.

  • By default, each cluster in a GDN contains 2 nodes. You can add up to 16 nodes.

Pricing

When you use a GDN, you are charged for the clusters and any inter-region data transfer fees. Data transfer fees vary based on whether the transfer is cross-border.

  • Non-cross-border data transfer (Free)

    • Scenario: The primary and secondary clusters are both deployed in regions outside the Chinese mainland, or both are deployed in regions within the Chinese mainland.

    • Billing rule: Free.

  • Cross-border data transfer (Billable)

    Important

    Cross-border data transfer fees will be charged starting from 00:00 on January 1, 2026 (Singapore time). Before this date, this service is free.

    • Scenario: One of your clusters (primary or secondary) is deployed in a region outside the Chinese mainland, and the other is deployed in a region in the Chinese mainland.

    • Billing rule: USD 0.80 per GB, billed hourly. The fee is calculated based on the amount of Redo Log data that is physically replicated from the primary cluster to a cross-border secondary cluster within one hour. You can estimate this traffic fee by querying the physical position converted from the log sequence number (LSN).

      Click to view a billing example

      Example

      For example, at 09:00, you query the physical write position of the log and it is ib_logfile1/648143676. At 10:00, the position is updated to ib_logfile3/648142342. This indicates that the amount of data written in this hour is the difference between the two positions.

      1. Amount written to the start file (ib_logfile1):
        Subtract the start offset from the total file size. Each log file is 1 GB (1,073,741,824 bytes). The amount written is 1073741824 - 648143676 = 425598148 bytes.

      2. Amount written to the intermediate file (ib_logfile2):
        After ib_logfile1 is full, the system completely writes ib_logfile2. This amount is 1,073,741,824 bytes (1 GB).

      3. Amount written to the end file (ib_logfile3):
        This is the offset at the end, which is 648142342 bytes.

      Therefore, the total amount written = 425598148 + 1073741824 + 648142342 = 2147482314 bytes. This is 2147482314 / 1024 / 1024 / 1024 = 1.999998 GB (rounded down to six decimal places). The cross-border data transfer fee for this hour is approximately 1.999998 GB × USD 0.80/GB = USD 1.5999984.

      Query the log write progress and physical file offset

      -- Query the current write progress of the log system.
      SHOW STATUS LIKE 'Innodb_log_write_lsn'; 
      +----------------------+------------+
      | Variable_name        | Value      |
      +----------------------+------------+
      | Innodb_log_write_lsn | 1721889596 |
      +----------------------+------------+
      
      -- Query the physical file offset in bytes.
      SELECT lsn_to_pos(1721889596); 
      +------------------------+
      | lsn_to_pos(1721889596) |
      +------------------------+
      | ib_logfile1/648143676  |
      +------------------------+
Note

If you use the global domain name feature, you will incur additional fees for internal DNS resolution and inter-region data transfer. For more information, see Global domain name pricing.

Get started

  1. Create and manage a Global Database Network: Select a cluster that meets the requirements as the primary cluster of the GDN.

  2. Add a secondary cluster: Go to the PolarDB buy page to add a secondary cluster to the GDN that you created.

  3. Connect to a Global Database Network: In a GDN, each cluster (primary and secondary) provides an independent cluster endpoint. You can connect to the endpoint of the nearest cluster based on your application's region. GDN also provides a global domain name. This feature not only enables nearest access but also ensures the domain name remains unchanged after a primary cluster switchover.