A key-value database
A storage engine with a WAL, indexes and compaction. Understand how and when your data is persisted.
Go · Rust
Implement the RESP protocol, an event loop and key expiry. A real server that talks to redis-cli.
Build it in your language
The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.
Redis is fast because it is simple: one process, in-memory structures, and a protocol plain enough to read by eye. It's the perfect server to reimplement.
You'll speak RESP, Redis's protocol, and build a server the official redis-cli connects to without noticing the difference. You'll start with PING and finish with key expiry, transactions and persistence.
10 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.
Accept connections, parse the protocol and answer PING and ECHO.
SET, GET, DEL, data types and compatible errors.
TTLs, lazy and active expiry, and list commands.
An event loop with many clients, MULTI/EXEC, and snapshots to disk.
A storage engine with a WAL, indexes and compaction. Understand how and when your data is persisted.
Go · Rust
Open a real .db, walk its B-trees and run SELECTs. Reverse engineering of a documented binary format.
Go · Python · Java
Build a vector index with exact search, filters, and a simplified HNSW graph.
TypeScript · Python · Go