Build your own Redis in 6 languages
Six standalone free courses. Each rebuilds Redis from scratch in idiomatic Python, Go, Node.js, Rust, Ruby, or Elixir. Same architecture, different runtimes. Every line lives in your own GitHub.
Ten modules, same shape, six languages
Each course follows the same ten-step architectural progression. The architectural lessons (RESP framing, atomic writes, fan-out, graceful lifecycle) transfer 1:1 across runtimes. The idioms differ.
Module 01
TCP echo
One listener, one task per connection. Multi-client from day one.
Module 02
RESP parser
Wire format with the language's native sum-type story.
Module 03
GET / SET
Shared map plus the language's idiomatic concurrency primitive.
Module 04
Expiry
Time-based TTLs with lazy delete. Monotonic clocks where available.
Module 05
AOF persistence
Append-only log with crash-safe replay.
Module 06
RDB snapshots
Atomic file rename. Clone-under-lock instead of fork.
Module 07
Pub/Sub
Fan-out via channels, queues, broadcast, or Registry.
Module 08
Replication
Master and replica over the same RESP wire your clients speak.
Module 09
Graceful shutdown
Signal handlers, drain in-flight work, persist before exit.
Module 10
Capstone benchmark
p50/p95/p99 latency comparison vs real Redis.
Taught by Param. Every line ends up in your own GitHub. Same architecture across all six runtimes, verified against real Redis on p50, p95, and p99 latency.
Pick your language
Each course is free, self-contained, and ships with a public workshop repo on GitHub. Start with the one you know; finish with one you do not.
Build your own Redis in Python
Reference language. Threads, selectors, dict + lock, dataclasses for the RESP sum type.
Idiom: Threads + selectors
Build your own Redis in Go
Goroutines, sync.RWMutex, channel-based pub/sub, context.Context graceful shutdown.
Idiom: Goroutines + channels
Build your own Redis in Node.js
Single-threaded event loop. net.createServer, Buffer cursor, Map without locks.
Idiom: Event loop + Map
Build your own Redis in Rust
Async tokio, enum sum types, Arc<Mutex<HashMap>>, broadcast channels, watch shutdown.
Idiom: tokio tasks + enum
Build your own Redis in Ruby
TCPServer + Thread per conn, Queue + write-pump for pub/sub, Signal.trap shutdown.
Idiom: Threads + Queue
Build your own Redis in Elixir
Process per conn, binary pattern matching, Registry pub/sub, OTP terminate/2 shutdown.
Idiom: Process + Registry
How the languages compare
Same architecture across all six. The constant factors differ. Real Redis (hand-tuned C) is the throughput target; each language closes a different fraction of the gap with idiomatic code.
| Concept | Python | Go | Node | Rust | Ruby | Elixir |
|---|---|---|---|---|---|---|
| Concurrency | Threads / selectors | Goroutines | Event loop | tokio tasks | Threads / Fibers | Processes |
| Shared state | dict + lock | RWMutex | Map (no lock) | Arc<Mutex<..>> | Hash + Mutex | GenServer state |
| Pub/Sub fan-out | List + lock | Buffered chan | Set<conn> | broadcast channel | Queue per sub | Registry + send/2 |
| Sum type | duck typing | interface{} | discriminated objects | enum | tagged array | tagged tuple |
| Typical throughput | 10-50k ops/s | 40-100k | 20-60k | 50-150k | 10-30k | 30-100k |
Questions before you start
- Are these courses really free?
- Yes. All six are standalone free courses. No upsell, no paywall on later modules. The capstone benchmark vs real Redis is in the free tier of every course.
- Do I need to take them in order?
- No. Each course is self-contained. Start with the language you know best to see how the architecture lands in familiar syntax, then pick a contrast language (e.g., Python first, then Elixir) to feel the differences.
- How long does each course take?
- About 8 to 9 hours of focused work per language. The Python course is the longest because it is the reference and we spend more time on the architecture explanation; the others are tighter because they assume the architectural concepts from the README.
- What if I find a bug?
- Every workshop repo is on GitHub. Open an issue or a pull request. Each course also has 4 exercises per module that intentionally surface different real-world hardening problems (fsync, partial writes, backpressure, etc.).