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.
- 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) orPX(milliseconds).
- Optional expiration using
- GET: Retrieve the value of a key.
- PING: Test connectivity with
- Key Expiry:
- Expiration for keys can be set with
EXorPXduring theSEToperation.
- Expiration for keys can be set with
- RESP Protocol:
- Implements the Redis Serialization Protocol (RESP) for parsing and sending responses.
- Asynchronous:
- Built with
asynciofor handling multiple connections concurrently.
- Built with
- Replication:
- Implements master-replica communication using the
REPLCONFandPSYNCprotocols.
- Implements master-replica communication using the
- Persistence:
- Data persistence is supported for reliable storage between sessions.
- Concurrency:
- Efficient handling of multiple clients using Go’s goroutines and synchronization primitives.
- Clone the repository:
git clone https://github.com/<your-username>/redis-clone.git
- Navigate to the project directory:
cd redis-clone - Run the server:
python app/main.py
- 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) orPX(milliseconds).
- Optional expiration using
- GET: Retrieve the value of a key.
- REPLCONF: Handle replica configuration.
- PSYNC: Synchronize data between master and replica.
- PING: Test connectivity with