Redis is one of those tools most backend developers use and few have looked inside. You type SET greeting hello EX 60 , the key is there, and a minute later it is gone. Between those two moments sit a wire protocol, a keyspace, an expiry algorithm and a durability story. Each is a topic you can read about for hours without really understanding it.
I wanted to understand them by writing them. redis-clone is a small Redis-compatible server in Go. It speaks the RESP2 protocol, keeps a keyspace with strings, lists and hashes, expires keys, and persists data in two ways: an append-only file (AOF) with rewrite, and snapshots. Real Redis clients work with it, and the tests talk to it through go-redis.
It is a learning project, not a Redis replacement.…