About | Features | References | Requirements | Installation | Contribution | License | Author
This project is a Redis-like server implemented in Go. It supports a variety of Redis commands across different data types, including Strings, Lists, Hashes, Sets, and Sorted Sets. Additionally, it provides basic server, connection, and persistence commands.
✔️ Available commands
- String Commands: SET, GET, DEL, EXISTS, INCR, DECR, INCRBY, DECRBY, MSET, MGET
- List Commands: LPUSH, RPUSH, LPOP, RPOP, LLEN
- Hash Commands: HSET, HGET, HDEL, HLEN, HMGET, HGETALL
- Set Commands: SADD, SREM, SMEMBERS, SISMEMBER
- Sorted Set Commands: ZADD, ZRANGE, ZREM
- Server and Connection Commands: EXPIRE, TTL, INFO, FLUSHALL, PING
- Persistence Commands: SAVE, BGSAVE
✔️ Persistence commands Saves data to disk and loads it on startup.
✔️ publish/subscribe functionality for real-time messaging.
- Redis Documentation - Data Types
- Redis Best Practices
- Build Redis from Scratch
- Redis Persistence Deep Dive
- Redis Persistence Guide
- Redis Pub/Sub
Before starting 🏁, you need to have Git and Go installed or Docker (optional, for containerization).
-
Clone the repository:
git clone https://github.com/Puneet-Pal-Singh/go-redis.git cd go-redis
-
Install dependencies:
go mod download
-
Build the application:
go build -o go-redis
You can run the application directly or use Docker.
go run ./main
-
Build the Docker image:
docker build -t go-redis .
-
Run the Docker container:
docker run -p 6378:6378 go-redis
Once the server is running, you can connect to it using a Redis client or through a terminal. The server listens on port 6378
.
-
Set a value:
SET key value
-
Get a value:
GET key
-
Delete a key:
DEL key
Contributions are welcome! Please open an issue or submit a pull request for any improvements or features.
This project is under license from MIT. For more details, see the LICENSE file.
Made with ❤️ by Puneet Pal Singh