https://github.com/yati-sagade/bitrust
Bitcask implementation in Rust
https://github.com/yati-sagade/bitrust
bitcask rust
Last synced: 8 months ago
JSON representation
Bitcask implementation in Rust
- Host: GitHub
- URL: https://github.com/yati-sagade/bitrust
- Owner: yati-sagade
- License: mit
- Created: 2018-06-19T22:57:53.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-31T09:23:22.000Z (over 4 years ago)
- Last Synced: 2025-01-31T08:51:16.891Z (over 1 year ago)
- Topics: bitcask, rust
- Language: Rust
- Size: 286 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
README
# Bitrust
This is a Rust implementation of [Bitcask](https://riak.com/assets/bitcask-intro.pdf), a persistent key-value store for
when the keyspace fits in memory. This is not a distributed datastore, but
can be used as a building block for one.
This crate hasn't been stress-tested. While it should be good enough for experimentation, we make no guarantees around data durability.
## Running
```shell
$ mkdir /tmp/bitrust_data
$ cargo run -- --configfile ./example_configs/no-automerge.toml --loglevel debug
> put foo bar
> get foo
Ok(Some("bar"))
> put baz spam
> put lala baba
> put baz egg
> lst
lala
foo
baz
> get baz
Ok(Some("egg"))
> quit
$ less /tmp/bitrust_data/bitrust.log
```
You can view the logs in a separate window by tailing `bitrust.log` in the
datadir.
```
$ tail -f /tmp/bitrust_data/bitrust.log
```
## Data directory contents
- Data files are stored as `N.data` where `N` is an integer starting at 0.
- `.activefile` contains the name of the current "active" log file (i.e., the
one taking writes). All other datafiles are immutable.
- `bitrust.log` contains logs. Level of logging is controlled by the `-l/--loglevel` switch.