Build your own key-value database
Build a key-value database from scratch. Implement a storage engine with a write-ahead log, indexes and compaction to understand data persistence.
Go · Rust
Build a Redis-compatible server from scratch. Implement RESP, an event loop and key expiry, then connect with the official 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.
Project in preparation: we are completing and verifying the implementation path and its tests. The capabilities below describe the project goal; starting the project is not enabled yet.
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.
Build a key-value database from scratch. Implement a storage engine with a write-ahead log, indexes and compaction to understand data persistence.
Go · Rust
Build a SQLite reader from scratch. Open a real database file, walk its B-trees and run SELECT queries by decoding the documented binary format.
Go · Python · Java
Build a vector search engine from scratch. Create a vector index with exact search, filters and a simplified HNSW graph for approximate search.
TypeScript · Python · Go