Skip to content

Your friendly neighborhood key-value store. 👜

License

Notifications You must be signed in to change notification settings

viveknathani/retain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

retain

retain is a key-value store. It is inspired by Redis and hence the client-server interaction is based on RESP over TCP. It implements a subset of commands supported by Redis.

Go Report Card Maintainability test release

motivation

I wrote this as a learning exercise. Redis or any key-value store in general excites me. The kind of things that you can do while implementing such a store are pretty abundant, if not limitless. You can ponder in different layers of this system with questions based on "how". Eg: how do you hold the data in memory? How do you handle concurrent access? What protocols do you use between the client and the server? If you want to persist data, how do you manage the pages to ensure efficient data reads/writes? If you want to make it distributed, what consensus algorithm do you bring in? You probably get the idea.

With that being said, it should be noted that this is not a production grade system and I maintain it at my free will. Don't use it for anything serious.

commands

Below is a list of the supported commands. It takes heavy inspiration from here.

  • ECHO message
  • PING [message]
  • GET key
  • SET key value
  • DEL key
  • MGET key [key ...]
  • MSET key value [key value ...]
  • SAVE

architecture

  • cmd/ directory contains the client and server programs that can be built and run.
  • protocol package implements RESP.
  • store package provides an API for interacting with the underlying map.

build

$ make build

After this, you can find the binaries under ./bin/.

contributing

PRs and discussions are welcome. It would be better if you open an issue before raising a PR.

license

MIT