Q-Store: Distributed, Multi-partition Transactions via Queue-oriented Execution and Communication

Thamir Qadah, Suyash Gupta, Mohammad SadoghiEDBT 2020

Introduction

Distributed database systems often struggle with the performance overhead of multi-partition transactions. Traditional non-deterministic protocols rely on Two-Phase Commit (2PC), which introduces significant latency due to multiple network round-trips and blocking synchronization. While deterministic systems like Calvin attempt to mitigate this by pre-ordering transactions, they frequently encounter bottlenecks in single-threaded sequencing and scheduling, failing to leverage the full potential of modern multi-core architectures.

Q-Store addresses these challenges by introducing a novel queue-oriented transaction processing paradigm. By decoupling transaction planning from execution and utilizing multi-threaded components for both, Q-Store achieves significant performance gains while maintaining strict determinism.

The Q-Store Architecture

The core innovation of Q-Store lies in its two-phase, multi-threaded execution model. Unlike previous deterministic systems that rely on a single-threaded sequencer, Q-Store distributes the planning and execution tasks across multiple cores and nodes.

Q-Store Distributed Architecture showing the flow from clients through planner threads to execution threads across multiple server nodes.

Multi-threaded Planning and Execution

  1. Planning Phase: A set of planning threads processes batches of transactions, decomposing them into fragments. These fragments are then placed into Execution Queues (EQs). The order within these queues is pre-determined, which implicitly resolves conflicts without the need for traditional locking or 2PC during the execution phase.
  2. Execution Phase: Worker threads pull transaction fragments from the EQs and execute them. This separation allows the system to scale vertically by utilizing all available CPU cores for both planning and execution.

Speculative Execution and Queue-based Communication

Q-Store is the first deterministic system to fully integrate speculative execution. It allows transaction fragments to read uncommitted data from preceding fragments in the queue. If an integrity constraint is violated, the system performs a rollback, but in most cases, this speculation significantly increases throughput. Furthermore, Q-Store optimizes network communication by exchanging entire queues of ordered operations between nodes, rather than individual messages, reducing the overhead associated with remote data access.

Performance Evaluation

The authors evaluated Q-Store using the YCSB and TPC-C benchmarks, comparing it against Calvin and traditional non-deterministic protocols like 2PL and MVCC.

Throughput (Transactions per Second) of Q-Store across varying batch sizes, demonstrating scalability up to 1 million TPS.

Key Results

  • Massive Throughput Gains: In YCSB workloads, Q-Store demonstrated up to a 22.1x improvement in throughput over Calvin. Under high contention, Q-Store maintained its performance while traditional protocols saw throughput collapse, resulting in a nearly 100x performance advantage.
  • Scalability: As shown in the evaluation results, Q-Store scales effectively with batch size and cluster size, reaching a peak throughput of over 1 million transactions per second on a 16-node cluster.
  • TPC-C Performance: On the complex TPC-C benchmark, Q-Store outperformed Calvin by 1.8x and the leading non-deterministic protocol by over 55x.

Conclusion

Q-Store rethinks distributed transaction processing by leveraging a queue-oriented, deterministic model. By eliminating the 2PC bottleneck and introducing multi-threaded planning and speculative execution, it provides a highly scalable solution for modern distributed databases. Future work includes exploring intra-partition parallelism and applying Q-Store's deterministic model to high-performance blockchain and Byzantine Fault Tolerant (BFT) systems.

Summary updated

BibTeX
@inproceedings{qadah2020q,
  author = {Thamir Qadah and Suyash Gupta and Mohammad Sadoghi},
  title = {{Q-Store: Distributed, Multi-partition Transactions via Queue-oriented Execution and Communication}},
  booktitle = {EDBT},
  year = {2020},
  doi = {10.5441/002/edbt.2020.08},
}
Figure