Here’s the revised README.md file, following your instructions:
Redis Clone is a lightweight, in-memory key-value store developed in Go, inspired by the core features of Redis. This project aims to provide a foundational understanding of key-value store architecture, concurrent client handling, and efficient data storage mechanisms.
The project currently supports a set of essential commands for interacting with strings, hashes, and lists, making it ideal for learning or experimenting with Redis-like functionality in Go.
- SET
key value
Store a key-value pair in the memory store. - GET
key
Retrieve the value associated with a key. - HSET
key field value
Store a field-value pair in a hash. - HGET
key field
Retrieve the value of a specific field in a hash. - HGETALL
key
Retrieve all field-value pairs of a hash.
- EXPIRE
key seconds
Set a timeout on a key. - DEL
key
Delete a key from the memory store. - EXISTS
key
Check if a key exists in the memory store.
Follow these steps to run and interact with the Redis Clone project:
First, clone this repository to your local system and navigate to the project directory:
git clone https://github.com/naman1402/redis-clone.git
cd redis-clone
Use Docker to build and run the project:
docker build -t redis-clone .
docker run -p 6379:6379 redis-clone
To interact with the Redis Clone server, you need redis-cli
. Follow these steps:
Follow the official guide to set up Redis on Windows using Ubuntu WSL:
Install Redis on Windows (via Ubuntu WSL)
Run the following commands in your WSL terminal to install Redis:
sudo apt update
sudo apt install redis-server
Even though you're using the Redis Clone, you need to start the redis-server
service for the CLI to function:
sudo service redis-server start
Once the server is running, connect to the Redis Clone with:
redis-cli -h localhost -p 6379
To manage Docker containers, use these commands:
- List running containers:
docker ps
- Stop a running container:
docker stop <container_id>
- Remove a stopped container:
docker rm <container_id>
- Delete the Docker image:
docker rmi redis-clone
This project was inspired by Redis, one of the most popular in-memory key-value databases. Redis Clone is built as a learning tool to deepen understanding of how Redis functions under the hood, focusing on architecture, concurrency, and protocol handling in Go.
Feel free to explore, experiment, and contribute! 🚀