DGCC: A New Dependency Graph based Concurrency Control Protocol for Multicore Database Systems

Chang Yao, Divyakant Agrawal, Pengfei Chang, Gang Chen, Beng Chin Ooi, Weng-Fai Wong, Meihui ZhangarXiv 2015

Introduction

Modern hardware architectures, characterized by dozens of CPU cores and massive RAM capacities, present a significant opportunity for database performance. However, traditional Database Management Systems (DBMSs) often struggle to scale linearly due to bottlenecks in concurrency control. In systems employing 2-Phase Locking (2PL) or Optimistic Concurrency Control (OCC), worker threads frequently waste cycles managing locks or handling transaction aborts and restarts.

Comparison of DGCC with traditional lock-based and timestamp-based protocols under contention.

As shown in Figure 1, traditional protocols often lead to deadlocks or validation failures in high-contention scenarios. Furthermore, the standard "one-thread-per-transaction" model fails to exploit fine-grained parallelism within individual transactions.

Methodology: The DGCC Protocol

The Dependency Graph based Concurrency Control (DGCC) protocol addresses these limitations by decoupling concurrency control logic from execution. This approach transforms conflict resolution into a pre-processing step, ensuring contention-free execution. It operates in three distinct phases:

1. Chopping and Batching

Incoming transactions are grouped into batches and "chopped" into smaller transaction pieces, typically corresponding to individual stored procedure calls.

2. Dependency Graph Construction

Before execution begins, DGCC constructs a directed acyclic graph (DAG) of these pieces. The graph incorporates two types of dependencies:

  • Logic Dependencies: These ensure that pieces belonging to the same transaction are executed in the correct sequence.
  • Time-order Dependencies: These are established between pieces from different transactions that access the same data records, enforcing serializability based on arrival order.
Construction of the dependency graph using logic and time-order dependencies.

3. Greedy Execution

A pool of worker threads executes the resulting graph. Any piece with an in-degree of zero is eligible for immediate execution. Since all potential conflicts are resolved during the construction phase, the execution phase requires no locks or runtime validation, effectively eliminating concurrency-related aborts.

Key Insights and Results

DGCC's primary advantage lies in its ability to convert a chaotic runtime environment into a structured execution plan. By enabling intra-transaction parallelism, independent operations within a single transaction can be processed simultaneously across multiple cores.

Experimental evaluations using YCSB and TPC-C benchmarks demonstrate DGCC's efficacy. In high-contention YCSB scenarios (80% writes), DGCC achieved up to 4x higher throughput than traditional protocols. While other methods saw performance plateaus or declines as core counts increased, DGCC exhibited superior scalability. Although batching introduces some initial latency, the overall average latency remains competitive because the system avoids the "long tail" of retries associated with traditional concurrency control.

Conclusion

DGCC represents a paradigm shift in concurrency control for multicore in-memory databases. By resolving conflicts upfront through dependency graphs, it maximizes CPU utilization and throughput in high-contention environments. Future work may address challenges related to dynamic access patterns in ad-hoc queries and optimizing for NUMA architectures.

Summary updated

BibTeX
@misc{yao2015dgcc,
  author = {Chang Yao and Divyakant Agrawal and Pengfei Chang and Gang Chen and Beng Chin Ooi and Weng-Fai Wong and Meihui Zhang},
  title = {{DGCC: A New Dependency Graph based Concurrency Control Protocol for Multicore Database Systems}},
  year = {2015},
  eprint = {1503.03642},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1503.03642},
}
Figure