A high-performance, fault-tolerant, horizontally scalable distributed key-value store built in Rust with strict ACID transactional guarantees.
- Multi-Raft Consensus (
raft-engine): Key-range sharded Multi-Raft implementation supporting Dynamic Region Range Splitting (at configurable 10,000 keys or 64MB thresholds),SplitCmdRaft log consensus,RegionEpochtracking, automatic leader election, snapshot transfers, and active load distribution across nodes. - Percolator 2-Phase Commit (
txn-coordinator): Decentralized 2PC implementation featuring primary & secondary lock resolution, Lock TTL Heartbeats, Conflict Detection via Hybrid Logical Clocks (HLC), write conflict rollbacks, permanentRollbackrecords, and non-blocking Percolator lock resolution for expired TTLs. - Asynchronous gRPC Request Batching & Pipelining (
client&node): Thread-safeBatchCollectorin client SDK buffering prewrite and commit mutations into high-throughput micro-batches (flushed every 2ms or 128 keys) overBatchPrewriteandBatchCommitgRPC RPCs, executed atomically in single Fjall database transaction batches on storage engine nodes. - Full Multi-Raft gRPC Network Pipeline (
raft-engine&node): Real streaming gRPC network transport overRaftService::StepandSendMessagewith Fjall disk persistence for RaftHardState,ConfState, snapshots, and uncommitted log entries in backgroundRawNode::ready()event processing loops. - MVCC Storage Engine (
storage): Partition-separated storage (DEFAULT,LOCK,WRITE) backed by Fjall engine with Multi-Version Concurrency Control timestamp encoding for lock-free point lookups, MVCC range scans, snapshot reads, and background MVCC Garbage Collection (gc_keys_older_than). - Jepsen-Style Chaos Fault-Injection Harness (
simulation): AsyncFaultyTransportproxy layer capable of injecting network partitions (isolated leaders), mid-2PC node crashes, and 30% asymmetric packet loss, validated bytest_chaos_linearizability_under_partitionandtest_chaos_orphan_lock_cleanup_on_node_crash.
crates/
├── proto/ # Protobuf compilation, KvService, TxnService & RaftService gRPC definitions
├── storage/ # Fjall storage engine, MVCC timestamp encoding, GC & median split key finder
├── raft-engine/ # Multi-Raft consensus engine, RaftStorage persistence, RaftCmd & RegionRouter
├── txn-coordinator/ # Percolator 2PC engine, HLC, lock resolver & atomic Fjall batch execution
├── node/ # Node server engine, Tokio gRPC services & background Raft ready processing loops
├── client/ # Client SDK, BatchCollector & kv-cli binary
└── simulation/ # Jepsen-style chaos fault injection, unit/integration tests & Criterion micro-benchmarks
cargo build --workspace./scripts/start-cluster.shOr using Docker Compose:
docker-compose up -d# Write key-value pair via 2PC transaction
cargo run --bin kv-cli -- put mykey myvalue
# Read value at current HLC timestamp
cargo run --bin kv-cli -- get mykey
# Range scan keys in range [start_key, end_key)
cargo run --bin kv-cli -- scan mykey1 mykey9 100cargo test --workspace./scripts/run-benchmarks.sh
# Or directly run criterion benchmark:
cargo bench -p simulation