What is global consistency (high-performance mode)
PolarDB for MySQL integrates its database kernel with a remote direct memory access (RDMA) network to provide global consistency (high-performance mode), also known as PolarDB-SCC (PolarDB-StronglyConsistentCluster). This mode delivers high-performance reads and writes while ensuring global data consistency. Compared with eventual consistency, enabling global consistency (high-performance mode) reduces cluster performance by no more than 10%. This topic describes the limits, technical principles, enabling procedure, and performance test comparisons for global consistency (high-performance mode).
Applicability
To enable global consistency (high-performance mode), your PolarDB for MySQL Enterprise Edition cluster must run one of the following versions:
-
Version 8.0.2: minor engine version 8.0.2.2.19 or later.
-
Version 8.0.1: minor engine version 8.0.1.1.29 or later.
-
Version 5.7: minor engine version 5.7.1.0.26 or later.
-
These are the minimum versions required to enable global consistency (high-performance mode). Independent configuration for each endpoint has additional version requirements. For more information, see Enable global consistency (high-performance mode) below.
-
For information about how to check your cluster version, see Query the engine version.
Usage notes
-
All read-only nodes in Serverless clusters have global consistency (high-performance mode) enabled by default.
-
Read-only nodes in secondary clusters of 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 hierarchical fine-grained modification tracking (MTT) optimization is already enabled for global consistency (high-performance mode), enabling Fast Query Cache alongside global consistency (high-performance mode) disables the MTT optimization.
Technical principles of global consistency (high-performance mode)
PolarDB for MySQL global consistency (high-performance mode) is built on PolarTrans, a newly designed timestamp-based transaction system. PolarTrans replaces the traditional transaction management mechanism in native MySQL, which relies on an array of active transactions. It supports scaling to distributed transactions and significantly improves single-node performance.
PolarDB global consistency (high-performance mode) uses a high-speed RDMA network to synchronize information interactively across multiple dimensions between primary and secondary nodes, as shown in the following figure. This mechanism replaces traditional primary-secondary log replication. A linear Lamport timestamp algorithm reduces timestamp retrievals by read-only (RO) nodes and avoids unnecessary waits for log replay.
-
Linear Lamport timestamps: This mechanism helps RO nodes obtain the latest modification timestamp more efficiently. Traditionally, an RO node retrieves a timestamp from the read-write (RW) node for every request. Even on a fast network, frequent retrievals cause significant overhead under heavy load. With linear Lamport timestamps, the RO node caches timestamps retrieved from the RW node locally. For requests that arrive before the cached timestamp is obtained, the RO node reuses that timestamp without retrieving another one from the RW node. This reduces timestamp retrieval overhead under heavy load and improves RO node performance.
-
Hierarchical fine-grained modification tracking: To improve RO node performance, the RW node maintains timestamps at three levels: global, table, and page. When an RO node processes a request, it first obtains the global timestamp. If that timestamp is later than the timestamp to which the RO node has replayed logs, the RO node does not immediately wait. Instead, it checks the timestamps of the tables and pages accessed by the request. The RO node waits for log replay only if the accessed page's timestamp still does not meet the consistency requirement. This avoids unnecessary waits and improves RO node response times.
-
RDMA-based log shipment: PolarDB global consistency (high-performance mode) uses a one-sided RDMA interface to ship logs from the RW node to RO nodes. This significantly increases log shipment speed and reduces CPU overhead.

Linear Lamport timestamps
RO nodes use linear Lamport timestamps to reduce read request latency and bandwidth consumption. When a request arrives at an RO node, it can reuse a timestamp that another request has already retrieved from the RW node. This avoids duplicate retrievals and improves performance while ensuring strong consistency.

In the preceding figure, an RO node processes two concurrent read requests, r1 and r2. Request r2 asks the RW node for a timestamp at t2 and, at t3, receives the RW node's timestamp TS3rw. The relationship between these events is e2TS3rwe3. Request r1 arrives at t1. Assigning a timestamp to each event on the RO node establishes the order of events on that node. If t1 precedes t2, the event order is e1e2TS3rwe3. The timestamp retrieved by r2 therefore reflects all updates made before r1 arrived. Request r1 can reuse the timestamp retrieved by r2 without requesting a new one. Each time the RO node retrieves a timestamp from the RW node, it caches the timestamp locally and records when it was obtained. A request that arrives before the cached timestamp was obtained can reuse that timestamp.
Hierarchical fine-grained modification tracking
To provide strongly consistent reads, an RO node first retrieves the latest transaction commit timestamp from the RW node. It must replay its logs to that timestamp before processing a read request. However, the data needed by the request may already be up to date while the RO node waits for log replay. To avoid unnecessary waits, PolarDB global consistency (high-performance mode) uses finer-grained modification tracking. The RW node maintains modification timestamps at three levels: the latest global modification timestamp, table-level timestamps, and page-level timestamps.
When processing a read request, the RO node first retrieves the global timestamp to check data consistency. If the global timestamp does not meet the consistency requirement, the RO node checks the target table's local timestamp for a finer-grained assessment. If that check also fails, the RO node checks the target page's timestamp. The RO node waits for log replay only if the page timestamp is still later than its log replay timestamp. This ensures that reads return the latest data.
On the RW node, all three levels of timestamps are stored in in-memory hash tables to reduce memory consumption. To further reduce memory usage, timestamps for multiple tables or pages may map to the same hash table entry. Only a larger timestamp can replace a smaller one. This ensures that consistency is maintained even when the RO node retrieves a larger timestamp. The following figure shows the implementation. TID and PID represent table IDs and page IDs, respectively. The RO node caches retrieved timestamps locally according to the linear Lamport timestamp mechanism so that other eligible requests can reuse them.

RDMA-based log shipment
In PolarDB global consistency (high-performance mode), the RW node writes logs directly to the RO node's cache by using one-sided RDMA. This low-latency process requires no CPU involvement on the RO node. As shown in the following figure, the RO and RW nodes maintain log buffers of the same size. A background thread on the RW node writes its log buffer to the RO node's log buffer over RDMA. The RO node reads its local log buffer instead of log files, which improves replication efficiency.

For more information, see RDMA-based log shipment.
Enable global consistency (high-performance mode)
Log on to the PolarDB console. On the target cluster's Basic Information page, in the Database Connections section, select the endpoint 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 detailed steps, see Configure PolarProxy.
The scope of global consistency (high-performance mode) depends on both the PolarProxy (database proxy) version and the minor engine version.
-
Per-endpoint configuration is supported when PolarProxy is version 2.9.12 or later and the minor engine version meets one of the following requirements. You can enable or disable global consistency (high-performance mode) independently for each endpoint without affecting other endpoints.
-
Version 8.0.2: minor engine version 8.0.2.2.29 or later.
-
Version 8.0.1: minor engine version 8.0.1.1.48 or later.
-
Version 5.7: minor engine version 5.7.1.0.38 or later.
-
-
If these conditions are not met, global consistency (high-performance mode) is configured at the cluster level. Enabling or disabling it for any endpoint also enables or disables it for all other endpoints in the cluster.
Performance comparison
-
Test environment
An 8-core, 32 GB PolarDB for MySQL 8.0 Cluster Edition cluster.
-
Test tool
Sysbench
-
Test data volume
25 tables with 250000 rows each.
-
Test results and explanation
The following figure compares mixed read/write performance for clusters using global consistency (high-performance mode). The chart labels are explained below:
-
Vertical axis (qps): the Sysbench test results.
-
Horizontal axis (threads): the number of concurrent Sysbench threads used in the test.
-
RW: All read and write requests go to the RW node, assuming that RO nodes cannot provide globally consistent reads.
-
Global consistency: global consistency provided by PolarProxy.
-
Global consistency (high-performance mode): kernel-provided global consistency (high-performance mode) is enabled, and PolarProxy is set to eventual consistency.
-
Eventual consistency: PolarProxy is set to eventual consistency for reads, and kernel-provided global consistency (high-performance mode) is disabled.
In the
sysbench oltp_read_writeworkload, global consistency (high-performance mode) reduces overall cluster performance by no more than 10% compared with eventual consistency.
-