Abstract
State machine replication is used to increase the availability of a service such as a data management system while ensuring consistent access to it. State-of-the-art implementations are based on a command log to gain linear write access to storage and avoid repeated transmissions of large replicas. However, the command log requires non-trivial state management such as allocation and pruning to prevent unbounded growth. By introducing in-place replicated state machines that do not use command logs, the log overhead can be avoided. Instead, replicas agree on a sequence of states, and former states are directly overwritten. This method enables the consistent, fault-tolerant replication of basic data management primitives such as counters, sets, or individual locks with little to no overhead. It matches the properties of fast, byte-addressable, non-volatile memory particularly well, where it is no longer necessary to rely on sequential access for good performance. Our approach is especially well suited for small states and fine-granular distributed data management as it occurs in key-value stores, for example.
Introduction
Traditional State Machine Replication (RSM) is the cornerstone of distributed systems, ensuring consistency across multiple replicas. Protocols like Paxos and Raft typically rely on a command log, where every operation is appended to a list and subsequently replayed by replicas to maintain a synchronized state. While robust for large-scale databases, this log-centric design introduces significant complexity and overhead when applied to fine-granular data primitives such as counters, sets, or distributed locks.
The Problem: The Overhead of Command Logs
In a standard RSM, the command log acts as an intermediary. Managing this log involves complex tasks: allocation, truncation (pruning old entries), and periodic snapshotting to prevent infinite growth. These operations are not only bug-prone but often exceed the resource cost of the actual data being replicated.
Historically, this design was necessitated by the performance characteristics of HDDs and SSDs, which favor sequential writes. However, with the advent of byte-addressable non-volatile memory (NVRAM), the requirement for sequential access is no longer a bottleneck, making the log-based approach an unnecessary abstraction for small states.
Proposed Method: In-Place RSM
The authors propose an In-Place RSM architecture that bypasses the command log entirely. Instead of reaching consensus on a sequence of commands, replicas agree directly on a sequence of states. When a new state is reached, the previous state is overwritten in-place.
Key Technical Innovations
- RMWPaxos (Read-Modify-Write Paxos): A variant of single-decree Paxos that utilizes consistent quorums. A proposer first queries replicas to establish the current state. If a majority agrees on the same state, the proposer applies a command locally and proposes the resulting new state.
- NVRAM Optimization: The system is tailored for byte-addressable memory like Intel Optane DC Persistent Memory (DCPMM). NVRAM allows for fine-grained, sub-microsecond updates, perfectly matching the "in-place" update model.
- Granular Replication: In the implementation using Scalaris (a distributed key-value store), every individual key-value pair is treated as its own independent RSM instance.
Evaluation and Results
The system was evaluated using synthetic workloads on a cluster of five nodes, comparing standard RAM, NVDIMM-N, and Intel Optane DCPMM.
- Throughput and Scaling: RMWPaxos demonstrated superior scalability compared to leader-based models like Raft. By distributing "leadership" across many independent RSM instances (one per key), the system achieved over 50,000 requests/sec, whereas single-leader systems bottlenecked at approximately 20,000 requests/sec.
- Latency: On DCPMM, the architecture achieved over 1 million writes per second with latencies under 2 microseconds for small writes (up to 1 KB).
- Recovery: Catch-up for lagging replicas is simplified. Instead of replaying a log history, a replica can simply overwrite its local state with the latest agreed-upon state from the quorum.
Discussion and Limitations
While highly effective for fine-granular data, the In-Place RSM approach has specific constraints:
- State Size: The cost of transmitting the entire state over the network makes this approach unsuitable for large states (e.g., multi-megabyte objects), where log-based command replication remains more efficient.
- Hardware Dependency: The performance benefits are most pronounced on NVRAM. On traditional block-based storage, the overhead of writing small updates to disk pages might negate the gains of removing the log.
Conclusion
In-place RSMs offer a streamlined, high-performance alternative to traditional log-based replication for distributed data management. By leveraging the unique properties of NVRAM and removing the complexities of log management, this approach enables efficient, leaderless scaling for the fine-granular primitives that power modern distributed systems.
Summary updated