Built a Redis-compatible in-memory data store from scratch in TypeScript using raw TCP sockets and a custom RESP implementation.
This project implements:
• TCP networking layer (Node net)
• Custom RESP parser and encoder
• In-memory storage engine
• Active and passive key expiration
• Append Only File (AOF) persistence
• Crash recovery via AOF replay
• Master–replica replication
• Offset-based partial synchronisation
• Multiple data structures (strings, lists, hashes)
The demo shows:
• TTL expiration in action
• AOF persistence survives server restart
• Initial full sync when replica connects
Source Code:
https://shorturl.at/8Qrxu
Built from first principles without Redis libraries.