Skip to content
Back to the catalog
Project redisDatabasesIntermediateBeta

Build your own Redis

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.

Guide language

The stage guides read in this language. Only languages this project is fully translated into show up here; the interface language does not change.

What this project is about

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.

Roadmap

10 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.

  1. Phase 12 stages

    Speaking RESP

    Accept connections, parse the protocol and answer PING and ECHO.

    1. 01RESP parser
    2. 02PING and ECHO
  2. Phase 23 stages

    A real store

    SET, GET, DEL, data types and compatible errors.

    1. 01SET and GET
    2. 02DEL and EXISTS
    3. 03Types and errors
  3. Phase 33 stages

    Time matters

    TTLs, lazy and active expiry, and list commands.

    1. 01TTL
    2. 02Lazy and active expiry
    3. 03Lists
  4. Phase 42 stages

    Concurrency and persistence

    An event loop with many clients, MULTI/EXEC, and snapshots to disk.

    1. 01Event loop and transactions
    2. 02Persistent snapshot

Before you start

A Redis-compatible server: a RESP protocol parser and serializer, string and list commands, TTLs with lazy and active expiry, an event loop serving many clients, MULTI/EXEC transactions and periodic snapshots to disk.

  • key-value-db
    Beta

    A key-value database

    A storage engine with a WAL, indexes and compaction. Understand how and when your data is persisted.

    Advanced14 stages~22 hDatabases
    walíndicescompactación+1

    Go · Rust

  • sqlite-reader
    Beta

    Read a SQLite file

    Open a real .db, walk its B-trees and run SELECTs. Reverse engineering of a documented binary format.

    Advanced10 stages~15 hDatabases
    formato binariobtreesql

    Go · Python · Java

  • vector-search-engine
    Beta

    Build a vector search engine

    Build a vector index with exact search, filters, and a simplified HNSW graph.

    Advanced5 stages~18 hDatabases
    vectoresbusqueda aproximadahnsw+1

    TypeScript · Python · Go