Redis Server from Scratch in TypeScript – Full Demo (TCP, RESP, AOF, Replica Sync)

Опубликовано: 04 Август 2026
на канале: Prince Jain
12
0

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.