acmpesuecc / hobbes

A Bitcask-like log-structured key-value store with an in-memory index, written in Rust
MIT License
0 stars 0 forks source link

Hobbes

A Bitcask-like log-structured key-value store with an in-memory index, written in Rust

Link to the blog

Usage

git clone https://github.com/anirudhsudhir/hobbes.git
cargo install --path .
./hobbes-server -h
Usage: hobbes-server [OPTIONS]

Options:
      --addr <addr>      set the server endpoint [default: 127.0.0.1:4000]
      --engine <engine>  set the storage engine [default: hobbes] [possible values: hobbes, sled]
  -h, --help             Print help
  -V, --version          Print version

hobbes-server
./hobbes -h
A Bitcask-like log structured key-value store written in Rust

Usage: hobbes [OPTIONS] <COMMAND>

Commands:
  get   return the value associated with a key
  set   store a key-value pair
  rm    delete a key-value pair from the store
  help  Print this message or the help of the given subcommand(s)

Options:
      --addr <addr>  set the endpoint to connect to [default: 127.0.0.1:4000]
  -h, --help         Print help
  -V, --version      Print version

hobbes set foo bar
hobbes get foo
hobbes rm foo

Features

Storage engines

Hobbes offers pluggable storage backends. Currently, there are two choices:

Client-server architecture

The key-value store is a server that listens for commands on the specified address. You may use a tool such as netcat instead of the hobbes client to send commands

echo "GET\rfoo\r\n" | nc localhost 4000
echo "SET\r<key>\r<val>\r\n" | nc <addr> <port>
echo "RM\r<key>\r\n" | nc <addr> <port>

The command and arguments are separated by a carriage return (CR)(\r), with a terminating newline (\n)