AdvisKV

A small, complete distributed key-value store in C++17 on Raft

Image 1 of 1: Shell session that creates a table with three replicas, kills the leader and keeps writing to the new one

A C++17 key-value store over gRPC: a Meta service keeps databases, tables and routes, Storage nodes serve hash-range shards replicated with Raft, WAL and snapshots, and an SDK caches routes and retries writes, with linearizable reads, CAS and online replica changes.

  • 9,800/sPuts, 3 replicas
  • 2.2 msGet p99, local cluster

Trade-offs

  • The KV engine is an in-memory map behind the WAL and snapshots, so durability and recovery are tested while storage engine work waits.
  • Meta runs as a single process: control-plane high availability is left out, while the data plane is replicated with Raft.
  • Shards are fixed hash ranges, with no splitting, migration or automatic rebalancing yet.

Q&A2

Every put, delete and CAS carries a request ID, reused on each retry. The state machine records applied IDs and skips a repeat without touching the data. The records have no expiry yet.

Reviews

Loading reviews

    More in Distributed systems

    See all 20 →
    • arbiterPostgreSQL job queue for Haskell, with no broker and no leader
    • RRQClosed-loop payment ledger on sharded Postgres with a Kafka outbox
    • RuvioRust key-value server that speaks RESP, with locks and queues as commands
    • EgresPostgres-compatible database in Zig for heavy, multi-tenant workloads
    • clinkC++ stream processing engine that stays correct when processes die
    • pg-statusSidecar that reports PostgreSQL master, replicas and replication lag

    More in gRPC

    See all 8 →
    • go-ledgerMulti-tenant double-entry payment ledger API in Go, built in public
    • ResonanceA local-first API client with no account, collections kept as YAML files
    • rustbgpdAn API-first BGP daemon in Rust for route servers and route reflectors
    • Crap CMSHeadless CMS in one Rust binary, with Lua hooks and a gRPC API
    • MycelA declarative microservice runtime: describe the connections, get the service
    • AstraCodeSelf-hosted online judge on Go services, Kafka and a sandbox

    More in Database internals

    See all 29 →
    • PaganelData migration engine that verifies the destination down to the row
    • FeOxDBEmbedded key-value store in Rust with write-behind durability
    • SNKVEmbedded key-value store built directly on SQLite's B-tree
    • musqlSQLite-compatible SQL engine on columnar storage and a JIT
    • MongrelDBEmbedded Rust database with vector, sparse and text indexes
    • MenteDBRust storage engine built for AI agent memory