A minimal Redis clone built using JavaScript and Node.js. This project provides a basic subset of the core Redis functionality, using hashmaps for key-value storage. It utilizes the redis-parser package to handle protocol parsing, allowing communication through a Redis-like CLI interface.
- Key-Value Storage: Supports
SETandGETcommands using hashmaps. - Redis Protocol Parser: Uses the
redis-parserpackage for request parsing. - Simple Node.js Implementation: Built with minimal dependencies.
- Expandable: Aims to add more Redis-like features in the future.
Follow the instructions below to install and run the service on your local machine.
- Node.js (v12+ recommended)
- npm (for package management)
- Clone the repository:
git clone https://github.com/Anish15AG/Build-your-own-REDIS.git cd your-redis-clone - Install Dependencies:
npm install redis-parser
- Run the Server:
node index.js
- Use the Redis CLI: In a separate terminal window, connect to the Redis service via::
redis-cli -p 8000
This Redis clone is a work-in-progress and currently lacks several functionalities found in the full Redis implementation:
-
Sorting algorithms (e.g., ZSETs) are not implemented.
-
Concurrency and multi-threading features are not supported (currently single-threaded).
-
Persistence mechanisms like snapshotting or AOF (Append-Only File) are missing.
-
Master-slave replication and cluster mode are not implemented.
-
Pub/Sub messaging functionality is currently not available.
These features may be considered in future updates to bring the service closer to the real Redis.
If you no longer need this Redis clone, follow these steps to uninstall it:
- Stop the server
bash Ctrl + C - Remove Repository and Files
bash cd ..rm -rf your-redis-clone