Rebuild the engine behind one of the world's most-used databases. In Go, grow a bare map into a real in-memory store — concurrent GET/SET, TTL expiry, atomic counters, LRU eviction, pub/sub, and atomic transactions.
Redis runs underneath an astonishing slice of the internet — caches, session stores, rate limiters, job queues, leaderboards, real-time feeds. It feels like a black box of pure speed. It isn't. Strip away the legend and Redis is, at heart, an in-memory key/value store guarded by careful concurrency — and in this project you rebuild a working slice of it yourself, from a bare struct to a real database, one small testable step at a time. The language is Go, and that's no accident: Go is the language of modern infrastructure (Docker, Kubernetes, and Redis-alikes like Dragonfly and KeyDB are all written in it), and a key/value store is the perfect playground for the features that make Go Go.
You start with the beating heart: Set / Get / Delete / Len, made safe for hundreds of concurrent goroutines with a sync.RWMutex — because a raw Go map under concurrent writes doesn't slow down, it crashes. Then you give keys a lifespan with TTL expiry, using an injectable clock so time-based behavior is fast and deterministic to test instead of flaky sleeps. You add atomic INCR/DECR counters and a type-safe generic GetAs[T] accessor — your first taste of Go generics — discovering that Redis has no integer type at all: it's strings, parsed atomically. You bound the store's memory with LRU eviction, dropping the least-recently-used key when it overflows. Then you turn the store into a message bus with channel-based publish/subscribe, where select and non-blocking sends fan a message out to every subscriber without one slow reader freezing the rest. Finally, the capstone: MULTI/EXEC transactions — buffered writes, read-your-writes visibility, and an all-or-nothing commit applied under a single lock.
Every challenge is graded by running real go test suites against your code, including a concurrency stress test that fires hundreds of goroutines at once and a fake-clock test that fast-forwards time. The tests are cumulative — green on Challenge 6 means all six layers still work together. By the end you'll have a single cohesive Store you built by hand, and you'll never again think of Redis — or mutexes, channels, and generics — as magic.