TL;DR
This paper challenges the long-held belief that distributed transactions inherently don't scale. The authors introduce NAM-DB, a novel database system designed from the ground up to leverage modern RDMA-enabled networking, demonstrating that distributed transactions with Snapshot Isolation can indeed scale linearly. This work has significant implications for simplifying application development and database provisioning by removing the need for complex data placement strategies.
What Problem Does This Paper Address?
The conventional wisdom in distributed systems is that distributed transactions are a scalability bottleneck. This has led to a proliferation of techniques to avoid them, such as complex data partitioning schemes, speculative execution, and relaxed consistency models. While these approaches can improve performance, they often place a significant burden on developers to understand and manage data placement, and can lead to unpredictable performance and high abort rates, especially in scenarios where data is not perfectly co-located. The authors argue that this "myth" of non-scalability is largely due to outdated database architectures and the limitations of traditional networking (like TCP/IP overhead), rather than an inherent limitation of distributed transactions themselves. They propose that with next-generation networks and a redesigned database architecture, distributed transactions can become a scalable and manageable primitive.
Methods
The core of the paper is the NAM-DB system, built upon the Network-Attached Memory (NAM) architecture. Key methodological contributions include:
- NAM Architecture: This architecture logically decouples compute and memory servers, with memory servers holding all data and compute servers executing transactions. It leverages RDMA for direct memory access, bypassing the CPU for data transfers. Locality is treated as an optimization, not a fundamental design principle.
- Scalable Snapshot Isolation (SI): NAM-DB implements SI using RDMA-enabled operations. A novel scalable global counter technique is introduced to generate commit timestamps without a single point of contention, addressing a key bottleneck in traditional SI protocols. This involves a "timestamp vector" where each component represents a counter for a specific compute server thread.
- RDMA-centric Design: The system is designed to maximize the use of one-sided RDMA operations (reads, writes, compare-and-swap) to minimize CPU overhead and latency.
- Multi-Versioning Scheme: A sophisticated multi-versioning scheme is implemented in memory servers to efficiently store and retrieve different versions of records, crucial for SI and supporting long-running transactions.
- Partitionable Data Structures: To avoid bottlenecks, data structures like the timestamp oracle are designed to be partitionable across memory servers.
Datasets
The primary dataset used for evaluation is the TPC-C benchmark. The authors also mention using a modified TPC-C to control the degree of data distribution for new-order transactions, allowing them to explicitly test the effect of locality.
Key Insights and Ideas
- The "Myth" is Realized, Not Inherent: The paper strongly suggests that the perceived lack of scalability in distributed transactions is a consequence of architectural choices and network limitations, not an intrinsic property of the transaction model itself.
- RDMA is a Game Changer: By leveraging RDMA, the system bypasses traditional network bottlenecks (CPU overhead, bandwidth limitations) that plague older distributed systems.
- Locality as an Optimization, Not a Requirement: NAM-DB demonstrates that with fast networks, data locality becomes a secondary concern, allowing for simpler application development and more predictable performance across a wider range of workloads.
- Scalable Timestamp Generation is Crucial: A significant contribution is the novel timestamp oracle that avoids the contention issues of centralized counters, enabling truly scalable SI.
- Decoupling Compute and Memory is Key: The separation of compute and memory servers, combined with RDMA, allows for independent scaling of both components and avoids memory servers becoming bottlenecks.
Key Results
- Linear Scalability: NAM-DB demonstrates nearly perfect linear scalability with the number of machines, reaching over 6.5 million new-order TPC-C transactions per second on 56 machines when locality optimizations are applied. Without locality, it scales to 3.64 million transactions per second on 56 machines.
- Performance Advantage: The system significantly outperforms previous state-of-the-art distributed transaction systems. For example, it achieves 2 million more transactions per second than Microsoft's FaRM on fewer machines.
- Timestamp Oracle Performance: The novel timestamp oracle can sustain up to 135 million t-trxs/sec with optimizations, far exceeding the performance of older approaches.
- Locality Impact: While locality provides a performance boost (around 30% in their experiments), the system remains highly performant even without it, highlighting the effectiveness of the RDMA-centric design.
- Contention Handling: The paper shows that while RDMA helps achieve scalability, inherently non-scalable workloads with high contention points will still exhibit limitations, but the system's abort rate is managed effectively.
Limitations and Future Work
- Network Partitioning: The current fault-tolerance scheme does not handle network partitioning, which is noted as a rare but potential issue in InfiniBand networks. The authors suggest more complex commit protocols (like Paxos) as a future direction.
- High Availability: The primary focus is on scalability, not high availability. Replicating the write-set during commit could be a path towards HA.
- Variable-Length Payloads: The current implementation primarily supports fixed-length payloads, though variable-length payloads are acknowledged as a potential extension.
- Future Work: The authors plan to investigate distributed index design for RDMA and explore other isolation levels in more detail. They also suggest partitioning the timestamp vector for even larger-scale deployments and exploring alternative indexing designs for B+ trees.
Summary updated