01
Protocol
Parses Redis protocol messages and routes commands through the server runtime.
protocol.rsProtocol. Persistence. Replication.
A toy Redis server in Rust that parses RESP, restores from RDB, replicates leader-follower state, supports streams, and queues transactional commands.
Implementation docs
Core capabilities
01
Parses Redis protocol messages and routes commands through the server runtime.
protocol.rs02
Loads database state from RDB files and restores key metadata.
rdb.rs03
Bootstraps replica handshake, full sync, and replicated write flow.
replication_client.rs04
Supports stream operations and queued transactional execution patterns.
cmd.rsRun it
cargo run -- --dir /some/db/path --dbfilename dump.rdb
cargo run -- --dir /some/db/path --dbfilename dump.rdb --port 6380 --replicaof "localhost 6379"
redis-cli PING
redis-cli SET foo bar
redis-cli INFO replication
redis-cli XREAD block 0 streams some_key 1526985054069-0
Implementation map
RESP parsing and request framing for incoming client and replication traffic.
Connection handling, command dispatch, and transaction orchestration.
In-memory storage backed by RDB parsing and initial database hydration.
Replica-side handshake, sync start, and downstream command consumption.
Implementation docs
A
Process entry, configuration, listener lifecycle, and shared server state.
Open chapterB
RESP parsing and encoding, string storage, expiry model, and stream containers.
Open chapterC
RDB parser internals, handshake flow, full sync, and replica fan-out.
Open chapterD
Command dispatch, stream semantics, transaction replay, and the full chapter map.
Open overview