Loading...
Loading...
Redis feels like a black box until you build a tiny version yourself. You start with a program that just listens on a port. By the end, the same program speaks the real Redis language, remembers data after a restart, and a backup machine quietly mirrors it. Pure standard library Go. No frameworks. No magic.
Engineers are learning here from
Build your own Redis in Go, one short main.go at a time. You will write a small server that listens on a port, then teach it the same language real Redis clients speak, then give it memory, then teach it to remember after a restart, then let many readers subscribe to one writer. By the end you will have a working stand-in for Redis you understand line by line. The Go idioms (goroutines, channels, sync.RWMutex, context) replace Python's threads and selectors while keeping the same shape.
Write your own Redis in Go, one short main.go at a time. Sockets, the wire language, the store, expiry, persistence, fan-out, and a backup machine. Pure standard library.
What you'll ship
What you'll learn
Curriculum
Network and protocol
Open a TCP port with net.Listen, accept per-connection goroutines, parse RESP with bufio.Reader.
Store and expiry
sync.RWMutex around map[string]string, then time.Time TTLs with lazy delete.
Durability: AOF and RDB in Go
Append-only file with serialised writes, then RDB snapshots that copy-then-save because Go cannot fork.
Messaging and replication
Channel-based pub/sub and master/replica log shipping. Same shape as Python, channel idioms instead of locks.
Scaling: Graceful shutdown and benchmark
The Go-shaped equivalent of Python\u2019s event-loop step is graceful shutdown via context. Then measure your server.
Who it's for
You write Go every day. You want a project that exercises net, sync, bufio, context, and channels in one cohesive build.
You know another language. You want to see Go idioms in a system that actually has hard requirements (concurrency, persistence, networking).
You wrote a Redis client and want to know what the server is doing on the other side of every wire byte.
FAQ
No. Each step starts from scratch and adds one architectural idea. By step 10 you understand the full shape.
Same architecture, different idioms. Python uses threads, GIL-protected dicts, and selectors. Go uses goroutines, sync.RWMutex, and graceful shutdown. The course README compares the two side by side.
No, but it closes most of the gap. Real Redis is hand-tuned C. Our Go version typically lands 2-3x slower than real Redis, depending on workload. The capstone benchmark step explains where the remaining gap comes from.
No. Pure standard library. Just Go 1.22+.
Write your own Redis in Go, one short main.go at a time. Sockets, the wire language, the store, expiry, persistence, fan-out, and a backup machine. Pure standard library.