Rediss is a simple Redis clone, written completely in Go.
- TCP server, supports multiple concurrent clients.
- RESP protocol for client-server communication.
- AOF persistence using RESP.
- Publish/Subscribe (it exists, but has issues with multiple clients, which kind of defeats the purpose).
- Client CLI built with Cobra to communicate with the server.
- Server CLI built with Cobra to handle the database, AOF, and requests from clients.
- Makefile to handle building, as well as the dev servers.
- Completed commands for GET, SET, HGET, HSET, HGETALL, PING, and DEL, as well as unfinished implementations of PUBLISH, SUBSCRIBE, and COMMAND.
- Support for subcommands, as shown in COMMAND.
- Custom error handling.
$ make build
$ rediss-cli
$ rediss-server
$ rediss-server --help
$ redis-server --host localhost
$ rediss-server --port 8080
$ rediss-server --aof /path/to/aof/file
$ rediss-cli --help
$ rediss-cli --host localhost
$ rediss-cli --port 8080
$ rediss-cli --command GET key
$ make dev-server
$ make dev-client
There were many great resources that helped me build this project. Here are some of them:
- Redis Docs
- Go Redis Github
- Build Redis from Scratch
- Redis Github
- And of course, Sina, who challenged me to a competition to build a Redis clone better than his in a week. Here's his version in C++.
This project is mostly meant as a short-term learning opportunity, but feel free to fork it to your own repo!