Building a Distributed Transactional Key-Value Store with Rust

Added:

Dynamo-Style Eventual Consistency and CRDTs

While a Raft- and RocksDB-based approach prioritizes strong consistency and strict ACID transactions (CP in the CAP theorem), a major alternative paradigm in distributed key-value store design prioritizes high availability and low latency (AP). Pioneered by Amazon's Dynamo paper, this counterpoint advocates for eventual consistency. Instead of heavy consensus protocols like Raft, which require majority agreement and can block writes during network partitions, AP systems utilize gossip protocols, sloppy quorums, hinted handoff, and Conflict-Free Replicated Data Types (CRDTs) to resolve concurrent write conflicts. This perspective argues that strict transactional consensus introduces significant performance bottlenecks, high tail latencies, and availability risks that are often unnecessary for large-scale web services.

Proficiency in Rust systems programming, including ownership, lifetimes, and asynchronous runtime concepts like Tokio.
Fundamental concepts of distributed systems, such as replication, the CAP theorem, and network partitioning.
Core mechanics of the Raft consensus algorithm, specifically leader election and log replication.
Basic knowledge of database storage engines, particularly Log-Structured Merge-tree (LSM-tree) architectures like RocksDB.
Database transaction theory, including ACID properties and concurrency control mechanisms such as Multi-Version Concurrency Control (MVCC).
Implementing Multi-Raft consensus and horizontal database sharding to scale the key-value store across multiple nodes.
Designing cross-shard distributed transactions using protocols like Two-Phase Commit (2PC) or the Percolator model.
Testing and verifying distributed system correctness and fault tolerance using partition testing frameworks like Jepsen.
Performance tuning and low-level optimization of Rust and RocksDB configurations (e.g., compaction strategies and block cache tuning).
Studying production-grade open-source implementations with similar architectures, such as TiKV or CockroachDB.
1.2K views11likes23:38@fosdemtalksOriginal Release: 2018-02-06

TiKV is a distributed transactional key-value database built with Rust that uses Raft consensus algorithm for data replication and consistency, RocksDB as the storage engine, and gRPC for inter-service communication, enabling horizontal scalability through sharding and supporting ACID-compliant transactions across distributed nodes.