Provide a simple key value store with persistent storage
set <key> <value>
get <key>
rm <key>
-
lib
Implments the main KvStore functionality, swappable backends withKvStore
andsled
another high performance key value embeddable database. One can add their own version by implementingKvsEngine
. -
crates/common
Exports protobuf definitions for the client-server communications protocol -
crates/kvs-client
andcrates/kvs-server
may run on the same or different machines as long as they can find each other on the network.kvs-client
essentially performs the same actions a user would perform on the CLI directly when runninglib/src/bin/main.rs
[except runningcompaction
, which shouldn't be a client's concern when interacting with the DB].
The protobuf definitions are found in crates/common/src/message.proto
. It may be extended or modified as seen fit.
To run, first build the workspace
./build.sh
Then run the kvs-server
with ./server.sh
which runs on localhost:4000
. You may include custom logging targets.
You may also start it at a different port, or with sled:
RUST_LOG=trace cargo r -p kvs-server --addr <Socket> --engine <kvs|sled>
Finally, interact with it using ./client set foo bar
which if --addr
is not provided, connects to localhost:4000
by default
cargo test --workspace