[Paper Review] Polyjuice: High-Performance Transactions via Learned Concurrency Control
Polyjuice proposes a learned concurrency control framework that uses offline training to discover high-performance, workload-specialized transaction scheduling policies. By modeling concurrency control as a policy space of fine-grained actions and optimizing via evolutionary algorithms, Polyjuice achieves 15% to 56% higher throughput than existing algorithms on TPC-C and TPC-E under moderate to high contention.
Concurrency control algorithms are key determinants of the performance of in-memory databases. Existing algorithms are designed to work well for certain workloads. For example, optimistic concurrency control (OCC) is better than two-phase-locking (2PL) under low contention, while the converse is true under high contention. To adapt to different workloads, prior works mix or switch between a few known algorithms using manual insights or simple heuristics. We propose a learning-based framework that instead explicitly optimizes concurrency control via offline training to maximize performance. Instead of choosing among a small number of known algorithms, our approach searches in a "policy space" of fine-grained actions, resulting in novel algorithms that can outperform existing algorithms by specializing to a given workload. We build Polyjuice based on our learning framework and evaluate it against several existing algorithms. Under different configurations of TPC-C and TPC-E, Polyjuice can achieve throughput numbers higher than the best of existing algorithms by 15% to 56%.
Motivation & Objective
- To address the performance variability of traditional concurrency control algorithms (e.g., 2PL, OCC) across different workloads.
- To overcome the limitations of heuristic-based hybrid approaches that rely on manual tuning or simple heuristics.
- To design a systematic, learnable framework that can discover novel, high-performance concurrency control policies tailored to specific workloads.
- To enable automatic, data-driven optimization of concurrency control beyond known algorithms.
Proposed method
- The framework defines a policy space of fine-grained actions—such as read version selection, write exposure, wait duration, and early validation—mapped to transaction access states.
- Each policy is represented as a lookup table mapping states (transaction type and access phase) to actions, enabling explicit modeling of concurrency control logic.
- Offline training uses an evolutionary algorithm to search the policy space for the configuration that maximizes commit throughput on a given workload.
- The system trains on replayed transaction traces, emulating execution under different policies to evaluate performance without live deployment.
- The approach supports both encoding known algorithms (e.g., OCC, 2PL) and discovering novel, optimized policies not seen in prior work.
- The framework is implemented in Polyjuice, a multi-core in-memory database system that dynamically selects policies per transaction based on learned tables.
Experimental results
Research questions
- RQ1Can a learning-based framework discover concurrency control policies that outperform hand-crafted algorithms like OCC and 2PL on real-world workloads?
- RQ2To what extent can a policy space of fine-grained actions enable the discovery of novel, high-performance concurrency control strategies?
- RQ3How does the performance of learned policies compare to existing hybrid or adaptive concurrency control mechanisms under varying contention levels?
- RQ4Is the offline training approach practical for real-world databases with predictable workloads?
Key findings
- Polyjuice achieves 15% to 56% higher throughput than the best existing concurrency control algorithms on TPC-C and TPC-E workloads under moderate to high contention.
- Under low contention, Polyjuice learns a policy equivalent to OCC but incurs an 8% performance overhead due to implementation complexity.
- The system discovers novel policies not found in existing algorithms, which exploit workload characteristics in subtle, performance-optimizing ways.
- The framework is effective for workloads with predictable access patterns, such as peak-hour traffic in e-commerce systems, where training on historical traces yields high-impact results.
- The policy space representation via lookup tables enables efficient evolutionary search, and the approach generalizes to both known and novel concurrency control strategies.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.