🚀 Built with Modern C++ • epoll • RESP2

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.

⚡ epoll
⚡ RESP2
⚡ Pub/Sub
⚡ AOF
⚡ TTL
⚡ Event Driven
Redis Playground

> 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.

Networking
epoll

Linux event-driven I/O

Protocol
RESP2

Redis Serialization Protocol

Persistence
AOF

Append Only File

Architecture
Single Thread

Lock-free event loop

Language
Modern C++

C++17 implementation

Playground
Live

Interactive web terminal