Skip to content

A lightweight Redis clone built in Go that implements core Redis functionality including basic commands, persistence through AOF, and key expiration. It supports concurrent connections, is thread-safe, and is compatible with standard Redis client.

Notifications You must be signed in to change notification settings

ashish-kamra/redis-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Redis Clone

A lightweight Redis-compatible server implementation in Go, supporting core Redis functionality and persistence.

Features

  • RESP (Redis Serialization Protocol) implementation for Redis compatibility
  • Basic Redis commands support:
    • PING - Test server connectivity
    • ECHO - Echo back the input
    • SET - Set key-value pairs with optional expiration
    • GET - Retrieve values by key
    • HSET - Set hash map entries
    • HGET - Retrieve hash map values
    • KEYS - Pattern-based key search
  • Persistence through Append-Only File (AOF) and automatic AOF recovery on server restart
  • Supports Key expiration
  • Supports concurrent connections while ensuring thread-safe operations

Getting Started

Prerequisites

  • Go 1.16 or higher

Installation

git clone https://github.com/ashish-kamra/redis-clone.git

cd redis-clone

go build ./cmd/server

Running the Server

./server -port 6379

The server will start listening on the specified port (default: 6379).

Connecting to the Server

You can connect to the server using any Redis client. For example, using redis-cli:

redis-cli -p 6379

About

A lightweight Redis clone built in Go that implements core Redis functionality including basic commands, persistence through AOF, and key expiration. It supports concurrent connections, is thread-safe, and is compatible with standard Redis client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages