K2: On Optimizing Distributed Transactions in a Multi-region Data Store with True-time Clocks

Haoze Song, Yongqi Wang, Xusheng Chen, Hao Feng, Yazhi Feng, Xieyun Fang, Heming Cui, Linghe Kong

TL;DR

This paper introduces K2, a novel multi-region data store designed to significantly boost the performance of distributed transactions by leveraging TrueTime Clocks (TTCs). K2 achieves this by introducing a new timestamp generation scheme, a revitalized multi-version concurrency control protocol, and an efficient visibility control mechanism, leading to an order of magnitude higher transaction throughput compared to existing geo-distributed transaction protocols.

What Problem Does This Paper Address?

Multi-region data stores are increasingly popular for their ability to offer strong consistency (like strict serializability) and ACID guarantees, which simplify application development. However, achieving high performance for these distributed transactions across geographically dispersed data centers is a major challenge due to the inherent latency of inter-region communication. While TrueTime Clocks (TTCs) offer a promising solution by providing accurate, globally synchronized timestamps with bounded uncertainty, previous attempts to integrate TTCs with distributed data stores, like Google Spanner, haven't fully realized their potential. This paper aims to bridge this gap by presenting K2, a data store that deeply exploits TTC capabilities to optimize distributed transactions for both performance and consistency.

Methods

K2 introduces three core innovations to optimize distributed transactions using TTCs:

  • K2 Timestamp Batching (K2-TB): Instead of equipping every server with a TTC, K2 employs a dedicated TTC Oracle cluster within each data center. This cluster uses PTP servers for high-accuracy time synchronization. K2-TB then batches timestamps from the Oracle, allowing local servers to serve most timestamp requests without remote coordination, significantly reducing latency and improving scalability. This approach also allows for smaller uncertainty bounds compared to Spanner.
  • K2 Multi-Version Timestamp Ordering (K2-MVTO): This is a revamped MVTO protocol that fully leverages TTCs. A key innovation is assigning a single, unified start timestamp to each transaction, which serves for both ordering and versioning. This eliminates the need for separate commit timestamps and enables a write-stream mechanism that allows multiple temporary writes to a single data tuple, making the protocol write-write conflict-free and avoiding deadlocks. It also supports asynchronous finalization of writes, reducing commit latency.
  • K2 Visibility Control (K2-VCR): For asynchronous replicas, K2-VCR introduces a new epoch-based visibility control protocol. It uses TTCs to define epochs, which are staggered across nodes. This allows replicas to serve reads efficiently while ensuring consistency. Unlike existing approaches that might block or abort transactions, K2-VCR collaboratively assigns commit epochs, ensuring that writes are atomically visible and preserving real-time order.

Datasets

The paper evaluates K2 using standard benchmarks:

  • TPC-C: A widely used benchmark for online transaction processing (OLTP) systems, used to evaluate K2's transaction throughput and latency under various conditions.
  • YCSB-T (Yahoo! Cloud Serving Benchmark - Transactions): Used for fine-tuning experimental parameters and studying K2's performance under different data skewness and contention levels.

No new benchmarks were introduced.

Key Insights and Ideas

  • TTCs are a powerful enabler for high-performance distributed transactions: The paper demonstrates that by carefully designing timestamp generation and transaction protocols around TTCs, it's possible to achieve strict serializability with significantly improved performance.
  • Batching timestamps is crucial for reducing coordination overhead: K2-TB's approach of batching timestamps from a central Oracle drastically cuts down on the latency and cost associated with obtaining timestamps, especially in intra-data-center scenarios.
  • Unified start timestamps simplify transaction protocols: By using a single start timestamp for both ordering and versioning, K2-MVTO eliminates complexities related to commit timestamps and enables more efficient conflict resolution, particularly for write-write conflicts.
  • Epoch-based visibility control offers a robust solution for replicas: K2-VCR's approach to managing data visibility at replicas, by leveraging TTC-defined epochs, provides a more efficient and less disruptive mechanism than existing safe or closed timestamp methods, avoiding unnecessary transaction aborts.

Key Results

  • Throughput: K2-MVTO achieved an order of magnitude higher transaction throughput compared to other geo-distributed transaction protocols. Specifically, it delivered 2.32x higher peak throughput than MVTO-HLC and 9.82x higher than D2PL-TTC on TPC-C.
  • Latency: K2-TB significantly improved timestamp latency by 15x and throughput by 1462x compared to a strawman approach. K2-MVTO also showed improved latency, with Figure 17b illustrating a lower P90 latency for NewOrder transactions.
  • Abort Rate: K2-MVTO demonstrated a lower abort rate due to its efficient conflict resolution mechanisms.
  • Replica Read Performance: K2-VCR achieved lower average visibility delay compared to SAFETS and CLOSETS (re-implementations of Spanner and CockroachDB approaches), with tail delays up to 7.6x smaller than SAFETS.

Limitations and Future Work

  • Epoch Interval Tuning: While K2-VCR's epoch generation is decentralized, the choice of epoch interval length can impact visibility delay and abort rates, requiring careful tuning for optimal performance. The paper suggests aligning epoch length with cross-region data transfer delays.
  • Synchronous Replication: The experiments were conducted without synchronous cross-region replication, which could affect commit latency in certain scenarios.
  • Future Work: The paper doesn't explicitly detail future work directions, but the success of K2 suggests potential avenues for further optimization in areas like more advanced TTC synchronization techniques, broader adoption of K2-MVTO's conflict resolution strategies, and exploring K2-VCR's applicability in different replication topologies. The authors also mention an extended version of the paper [40] for more detailed discussions on correctness and fault-tolerance.

Summary updated

BibTeX
@article{song2025k,
  author = {Haoze Song and Yongqi Wang and Xusheng Chen and Hao Feng and Yazhi Feng and Xieyun Fang and Heming Cui and Linghe Kong},
  title = {{K2: On Optimizing Distributed Transactions in a Multi-region Data Store with True-time Clocks}},
  journal = {Proc. VLDB Endow.},
  year = {2025},
  doi = {10.14778/3725688.3725704},
}
Figure