README.md

January 24, 2018 ยท View on GitHub

BoJack

The unreliable key-value store

Status

Originally, from my article "Why you should build your own NoSQL Database". BoJack is a bit mature now, yet missing several important features:

  • Cluster-friendliness
  • Security Layer (#34)
  • Unix Socket support (#48)

Feel free to share your thoughts and contribute.

Installation

Requirements

  • The latest version of Crystal (0.24.x)
  • LLVM development files

Steps

  1. Clone the repo: git clone https://github.com/marceloboeira/bojack
  2. Switch to repo-directory: cd bojack
  3. Build: make install (sudo for linux users)

Showtime

  1. Start the server, run: bojack server
  2. Connect a client, in another tab, run: bojack client
$ bojack console
> set food ๐Ÿฃ
๐Ÿฃ
> get food
๐Ÿฃ
> ping
pong

By default BoJack runs at 127.0.0.1:5000.

Usage

CLI

Currently the command-line interface supports two commands: server and console.

bojack <server/console> <flags>

Server

flagdescription
--hostnameHostname the server will run127.0.0.1
--portPort the server will run5000
--logPath for a log fileSTDOUT
--log-levelLevel of messages loggedDEBUG = 0, INFO = 1 (default), WARN = 2, ERROR = 3, FATAL = 4

Console

flagdescriptiondefault
--hostnameHostname this console will connect127.0.0.1
--portPort this console will connect5000

Commands

List of available commands for BoJack

commanddescriptionparamsexamplereturn
setsets a key with the given name and valuekey, valueset foo barthe value of the key "bar"
incrementincrements the given key value by 1keyincrement foothe value of the key "foo" incremented
getgets the value of the given valuekeyget foothe value stored at the key, "bar"
deletedeletes the given keykey, *delete foo, delete *the value at the deleted key "bar" or every key in the database, if "*" is given instead of a key
appendadd one or more values to the end of a listkey, valueappend list foo,barthe list resulted
popretrieve the last item of the listkeypop foothe last value stored at the list, "foo"
sizereturn the number of stored items--sizethe value of stored keys in memory
pingchecks the server--pingpong if everything is correct

Clients

Want to use BoJack with your language? Currently, we support:

  • Crystal - Thanks to @hugoabonizio
  • Python - Thanks to @mauricioabreu
  • Ruby - Thanks to @hugoabonizio
  • Elixir - Thanks to @veelenga

Contributing

Found a bug? Have a suggestion? Please open an issue.

Want to contribute? Take a look at our open issues and make sure you follow our guide.

License

Check the License here.