Redis Clone
A high-performance in-memory database built completely from scratch in Modern C++. Supports non-blocking sockets, epoll, RESP protocol, persistence, Pub/Sub and TTL expiration.
> SET name Shubham
OK
> GET name
"Shubham"
> HSET user age 20
(integer) 1
>█
Features
A production-inspired Redis clone implementing networking, persistence, expiration, and messaging from scratch.
⚡ Event Driven
Built using Linux epoll with non-blocking sockets for handling thousands of concurrent connections efficiently.
📦 RESP Protocol
Implements the Redis Serialization Protocol (RESP2) allowing compatibility with redis-cli and custom clients.
💾 AOF Persistence
Append Only File persistence with replay on startup and automatic rewrite support.
⏰ TTL Expiration
Supports EXPIRE, TTL and automatic active expiration cycles.
📡 Pub/Sub
Publish and subscribe messaging between multiple connected clients.
🚀 Modern C++
Written completely in Modern C++ with an event-driven architecture and zero external database dependencies.
System Architecture
Every command travels through the complete networking stack before reaching the Redis engine.
🌐 Browser
Interactive playground built with Next.js and React.
⚡ API Route
Receives commands and forwards them over a raw TCP socket.
📦 RESP Protocol
Commands are encoded using Redis Serialization Protocol (RESP2).
🚀 Redis Clone
Modern C++ server using epoll and non-blocking sockets.
💾 Data Store
Stores Strings, Lists, Hashes, Sets, TTL metadata and AOF persistence.
Technical Highlights
Core technologies and design choices behind the Redis Clone.
Linux event-driven I/O
Redis Serialization Protocol
Append Only File
Lock-free event loop
C++17 implementation
Interactive web terminal