Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Practice build · Data stores and distributed systems

Build your own Redis

An in-memory key-value server that speaks the Redis protocol, so redis-cli can talk to it, with key expiry and persistence.

  • Intermediate
  • About 15–30 h
  • 5 checkpoints
  • 4 tutorials · C++, Go, Python

Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.

Choose a tutorial

Why build it

Redis combines a network protocol, an event loop, data structures and durability in one small server. Rebuilding it shows how a cache behaves under load, expiry and restarts.

You will be able to

  • Parse and serialise the RESP protocol.
  • Serve many clients with an event loop or async I/O.
  • Implement key expiry and explain lazy versus active expiration.
  • Persist data with an append-only file and recover after a crash.

Skills it exercises

Recommended on Backend Engineer and System Design.

Checkpoints

How you know you are there

Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.

  1. Checkpoint 1Self-check

    PING

    Done when: redis-cli -p 6380 PING returns PONG from your server.

  2. Checkpoint 2Self-check

    GET and SET under load

    Done when: GET, SET and DEL work, and redis-benchmark with 50 parallel clients runs without errors.

  3. Checkpoint 3Self-check

    Expiry

    Done when: SET k v PX 100 disappears after 100 ms, both when it is read and when it is never read again.

  4. Checkpoint 4Self-check

    Persistence

    Done when: After kill -9 and a restart, data written before the crash is restored from an append-only file.

  5. Checkpoint 5Self-check

    Data structures

    Done when: LPUSH and LRANGE, or ZADD and ZRANGE, return the same results as real Redis for the same commands.

Stretch goals

  • Replication to a second instance.
  • Benchmark against real Redis and explain the difference.
Follow a tutorial

Step-by-step guides

Pick one in a language you know (tutorial languages: C++, Go, Python, Rust). They open on the author’s site.

Where to go next

Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.

Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.