Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weezy20/kvs
KVS [ Key Value Store/String ] A fast cli app / library, to persistently store UTF-8 based string key, value pairs. Uses swappable backends: KvStore and sled.
https://github.com/weezy20/kvs
cli key-value-store structured-logging
Last synced: 24 days ago
JSON representation
KVS [ Key Value Store/String ] A fast cli app / library, to persistently store UTF-8 based string key, value pairs. Uses swappable backends: KvStore and sled.
- Host: GitHub
- URL: https://github.com/weezy20/kvs
- Owner: weezy20
- Created: 2023-02-23T15:40:31.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-06T15:47:35.000Z (about 2 months ago)
- Last Synced: 2024-11-06T16:44:54.273Z (about 2 months ago)
- Topics: cli, key-value-store, structured-logging
- Language: Rust
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# KVS - A simple command line key-value datastore
## Purpose
Provide a simple key value store with persistent storage
1. `set `
2. `get `
3. `rm `## Structure
1. `lib` Implments the main KvStore functionality, swappable backends with `KvStore` and `sled` another high performance key value embeddable database. One can add their own version by implementing `KvsEngine`.
2. `crates/common` Exports protobuf definitions for the client-server communications protocol
3. `crates/kvs-client` and `crates/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 running `lib/src/bin/main.rs` [except running `compaction`, which shouldn't be a client's concern when interacting with the DB].
## Development
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 --engine `
Finally, interact with it using `./client set foo bar` which if `--addr` is not provided, connects to `localhost:4000` by default
## Tests
`cargo test --workspace`