Skip to content

kanielrkirby/rediss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rediss

Rediss is a simple Redis clone, written completely in Go.

Features

  • 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.

Usage

Building

To build the rediss-server and rediss-cli binaries

$ make build

To run the rediss-server and rediss-cli binaries

$ rediss-cli
$ rediss-server

Supported flags for the rediss-server

$ rediss-server --help
$ redis-server --host localhost
$ rediss-server --port 8080
$ rediss-server --aof /path/to/aof/file

Supported flags for the rediss-cli

$ rediss-cli --help
$ rediss-cli --host localhost
$ rediss-cli --port 8080
$ rediss-cli --command GET key

Running the dev servers

To run the dev server for the server-side

$ make dev-server

To run the dev server for the client-side

$ make dev-client

References and Honorable Mentions

There were many great resources that helped me build this project. Here are some of them:

Contributions

This project is mostly meant as a short-term learning opportunity, but feel free to fork it to your own repo!