PyRedis
A Redis-compatible server in Python, from scratch.
A single-threaded reactor over non-blocking sockets and a selectors event loop, with a cursor-threaded RESP parser that serves pipelined commands without re-scanning buffered bytes. Built to understand why Redis is fast, not to replace it.
A JavaScript sketch of the same keyspace, running in your tab, with lazy expiry on read. The real server is Python and speaks RESP over TCP.
Worked example · three pipelined commands in one read
After each frame, scan the buffer again from byte zero. Red cells are bytes it has already handled.