Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A lightweight implementation of a Redis-like server in Python.

License

Notifications You must be signed in to change notification settings

SmitUplenchwar2687/Redis-Clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Redis Clone

A lightweight implementation of a Redis-like in-memory data store in Python. This project supports basic Redis commands like PING, ECHO, SET, and GET, as well as key expiration features. It also supports core Redis functionalities like key-value storage, replication, and basic client-server communication.


Features

  • Commands Supported:
    • PING: Test connectivity with PONG.
    • ECHO: Echo back the provided message.
    • SET: Store a key-value pair in the in-memory store.
      • Optional expiration using EX (seconds) or PX (milliseconds).
    • GET: Retrieve the value of a key.
  • Key Expiry:
    • Expiration for keys can be set with EX or PX during the SET operation.
  • RESP Protocol:
    • Implements the Redis Serialization Protocol (RESP) for parsing and sending responses.
  • Asynchronous:
    • Built with asyncio for handling multiple connections concurrently.
  • Replication:
    • Implements master-replica communication using the REPLCONF and PSYNC protocols.
  • Persistence:
    • Data persistence is supported for reliable storage between sessions.
  • Concurrency:
    • Efficient handling of multiple clients using Go’s goroutines and synchronization primitives.

Installation

  1. Clone the repository:
    git clone https://github.com/<your-username>/redis-clone.git
  2. Navigate to the project directory:
    cd redis-clone
  3. Run the server:
    python app/main.py
    

Usage

  • Running the server:
    • PING: Test connectivity with PONG.
    • ECHO: Echo back the provided message.
    • SET: Store a key-value pair in the in-memory store.
      • Optional expiration using EX (seconds) or PX (milliseconds).
    • GET: Retrieve the value of a key.
    • REPLCONF: Handle replica configuration.
    • PSYNC: Synchronize data between master and replica.

About

A lightweight implementation of a Redis-like server in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages