
Series
Build Redis From Scratch
Thirteen parts, from an empty Maven project to a server that speaks RESP, persists to disk, and replicates to a second instance, plus a reference of every link they lean on. Java, no libraries.
- 14 parts
- 12.9 hours total
- beginner to intermediate to advanced
- Java · Maven · Sockets
Getting started
1 partThe wire
4 parts- TCP before RedisA server that listens on port 6379, accepts clients, and echoes back whatever they send. about 45 minutes beginner
- One read is not one requestFraming that splits a byte stream into requests, then a server that handles many clients at once. about 40 minutes beginner
- What redis-cli actually sendsA RESP parser, a RESP writer, and the project's first tests. about 60 minutes intermediate
- Bytes become commandsA command dispatcher, plus PING and ECHO. about 30 minutes intermediate
A database, and time
3 partsBeyond key and value
3 parts- The server speaks firstPub/sub, streams, and a blocking XREAD. about 80 minutes intermediate
- Four more typesHashes, sets, sorted sets, and SCAN. about 70 minutes advanced
- The commands that make it usableCONFIG GET, INFO, DBSIZE, FLUSHALL, command line options, the TTL family, and the rest of the string API. about 50 minutes advanced