All Products
Search
Document Center

PolarDB:What is global consistency (high-performance mode)

Last Updated:Oct 08, 2026

PolarDB for MySQLdeeply integrates the database kernel with the RDMA network to provide global consistency (high-performance mode), short for PolarDB-SCC (PolarDB-StronglyConsistentCluster). It delivers high-performance data reads and writes while ensuring global data consistency. Compared with eventual consistency solutions, the cluster performance overhead stays within 10% after global consistency (high-performance mode) is enabled. This topic describes the usage limits, technical principles, how to enable, and performance benchmark comparisons of global consistency (high-performance mode).

Applicable scope

To enable global consistency (high-performance mode), PolarDB for MySQL Enterprise Edition clusters must be one of the following versions:

  • 8.0.2 with a minor kernel version of 8.0.2.2.19 or later.

  • 8.0.1 with a minor kernel version of 8.0.1.1.29 or later.

  • 5.7 with a minor kernel version of 5.7.1.0.26 or later.

Note

For more information about how to check the cluster version, see Query the engine version.

Precautions

  • Global consistency (high-performance mode) is enabled by default for all read-only nodes in Serverless clusters.

  • Read-only nodes of secondary clusters in a Global Database Network (GDN) do not support global consistency (high-performance mode).

  • Global consistency (high-performance mode) is compatible with Fast query cache. If the hierarchical fine-grained modification tracking (MTT) optimization of global consistency (high-performance mode) was previously enabled, and you enable both Fast Query Cache and global consistency (high-performance mode) at the same time, the MTT optimization of global consistency (high-performance mode) becomes invalid.

Technical solution of global consistency (high-performance mode)

PolarDB for MySQLGlobal consistency (high-performance mode) is built on PolarTrans, a newly designed timestamp-based transaction system that reconstructs the traditional transaction management approach based on active transaction arrays in native MySQL. The system supports distributed transaction scaling and significantly improves single-node performance.

PolarDBThe following figure shows how global consistency (high-performance mode) is implemented. It uses a high-speed RDMA network to build an interactive, multi-dimensional primary/secondary information synchronization mechanism that replaces the traditional primary/secondary log replication architecture. The linear Lamport timestamp algorithm reduces the number of times that a read-only (RO) node obtains timestamps and avoids unnecessary waits for log replay.

  • Linear Lamport timestamp: To improve the efficiency with which an RO node obtains the latest modification timestamp, the system introduces the linear Lamport timestamp mechanism. In the traditional approach, an RO node must obtain a timestamp from the read/write (RW) node every time it processes a request. Even with a fast network, this creates significant overhead under high load. With the linear Lamport timestamp, an RO node can store the timestamp obtained from the RW node locally. For a request that is earlier than the locally stored timestamp, the RO node can directly use the local timestamp without obtaining another one from the RW node. This mechanism effectively reduces the overhead of frequent timestamp retrieval under high load and improves the performance of the RO node.

  • Hierarchical fine-grained modification tracking: To improve RO node performance, the RW node introduces a multi-level timestamp mechanism: global, table-level, and page-level. When an RO node processes a request, it first obtains the global timestamp. If the global timestamp is later than the timestamp to which the RO node has replayed logs, the RO node does not immediately enter a waiting state. Instead, it continues to check the timestamps of the table and page that the request accesses. The RO node waits for log replay to complete only if the timestamp of the accessed page still does not meet the condition. This mechanism effectively avoids some unnecessary waits for log replay and improves the response speed of the RO node.

  • RDMA-based log shipment: PolarDBGlobal consistency (high-performance mode) uses a one-sided RDMA interface to ship logs from the RW node to the RO node. This greatly improves log shipment speed and reduces the CPU overhead caused by log shipment.

image

Linear Lamport timestamp

To reduce the latency and bandwidth consumption of read requests, an RO node can use the linear Lamport timestamp mechanism. When a request reaches an RO node and another request has already obtained a timestamp from the RW node, the RO node can directly reuse that timestamp. This avoids repeated requests and ensures strong consistency while improving performance.

image

In the preceding figure, two concurrent read requests r1 and r2 reach an RO node. r2 sends a request to the RW node for a timestamp at t2 and, at t3, obtains the RW node timestamp TS3rw. The relationship between these events is e2TS3rwe3. r1 arrives at t1. Assigning a timestamp to each event on the RO node determines the order of different events on the same RO node. If t1 is earlier than t2, the relationship between the events is e1e2TS3rwe3. In other words, the timestamp obtained by r2 already reflects all updates made before r1 arrived. Therefore, r1 can directly use the timestamp of r2 without obtaining a new timestamp. Based on this principle, each time an RO node obtains a timestamp from the RW node, the RO node saves the timestamp locally and records the time when the timestamp was obtained. If the arrival time of a request is earlier than the time when the locally cached timestamp was obtained, the request can directly use that timestamp.

Hierarchical fine-grained modification tracking

To perform strongly consistent reads, an RO node must first obtain the latest commit timestamp of the current transaction on the RW node, and wait until its logs are replayed to that timestamp before it processes a read request. However, while the RO node waits for log replay, the data required by the current request may already be the latest, and no wait is required. To avoid unnecessary waiting, PolarDBglobal consistency (high-performance mode) uses more fine-grained modification tracking. The RW node maintains three levels of modification information: the global latest modification timestamp, the table-level timestamp, and the page-level timestamp.

When processing a read request, an RO node first obtains the global timestamp to determine data consistency. If the global timestamp does not meet the condition, the RO node further obtains the local timestamp of the target table for more fine-grained verification. If the condition is still not met, the RO node continues to check the timestamp of the target page for a more precise determination. The RO node must wait for log replay only when the page timestamp is still later than the timestamp to which its logs have been replayed. This ensures that the RO node reads the latest data.

On the RW node, all three levels of timestamps are stored in an in-memory hash table to reduce memory consumption. To further optimize memory usage, the timestamps of multiple tables or pages can be mapped to the same hash table entry. To ensure consistency, only a larger timestamp can replace a smaller one. This design ensures that consistency is not compromised even if an RO node obtains a larger timestamp. The following figure shows the implementation, in which TID and PID indicate the table ID and the page ID, respectively. A timestamp obtained by an RO node is cached locally based on the linear Lamport timestamp design so that other eligible requests can use it.

image

RDMA-based log shipment

In PolarDBglobal consistency (high-performance mode), the RW node remotely writes logs to the RO node cache over one-sided RDMA. This process does not require the CPU of the RO node and has low latency. The following figure shows the implementation. The RO node and the RW node both maintain log buffers of the same size. A background thread of the RW node writes the RW log buffer to the RO log buffer over RDMA. The RO node reads the local log buffer instead of reading files, which accelerates replication synchronization.

image

Note

For more information about RDMA-based log shipment, see RDMA-based log shipment.

Enable global consistency (high-performance mode)

Log on to the PolarDB console. On the Basic Information page of the target cluster, in the Database Connections section, select the connection address for which you want to enable global consistency (high-performance mode), click Configure, set Consistency Level to Global Consistency (Strong), and set Global Consistency Mode to High-performance Mode. For more information about the procedure, see Configure the database proxy.

Note

Global consistency (high-performance mode) takes effect on all addresses in a cluster at the same time. If you enable it for one address, it is enabled for all other addresses in the cluster.

Performance comparison

  • Test environment

    An PolarDB for MySQL 8.0 cluster of the Cluster Edition edition with 8 cores and 32 GB of memory.

  • Test tool

    Sysbench

  • Test data volume

    25 tables, each containing 250,000 rows.

  • Test results and description

    The following figure shows the mixed read/write performance comparison of a global consistency (high-performance mode) cluster. Chart description:

    • Vertical axis (qps): the Sysbench test result.

    • Horizontal axis (threads): the number of concurrent Sysbench threads used during the test.

    • RW: All read and write requests are sent to the RW node, assuming the RO node cannot provide globally consistent reads.

    • Global consistency: the global consistency feature provided by the proxy.

    • Global consistency (high-performance mode): the proxy setting that enables the kernel-provided global consistency (high-performance mode) and ultimately configures eventual consistency.

    • Eventual consistency: the proxy is configured for eventual consistency reads, and the kernel-provided global consistency (high-performance mode) is disabled.

    In the sysbench oltp_read_write scenario, compared with eventual consistency, the overall cluster performance overhead of global consistency (high-performance mode) is within 10%.

    image