https://github.com/hdt3213/bitcask
a tiny kv database by bitcask
https://github.com/hdt3213/bitcask
Last synced: about 1 month ago
JSON representation
a tiny kv database by bitcask
- Host: GitHub
- URL: https://github.com/hdt3213/bitcask
- Owner: HDT3213
- License: gpl-3.0
- Created: 2023-07-23T13:32:56.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-31T13:30:23.000Z (over 1 year ago)
- Last Synced: 2025-01-30T13:27:20.153Z (3 months ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bitcask
a tiny kv database by bitcask
## Example
```rust
let mut database = Database::open("testdata", Options::default()).unwrap();
let key = "hello".to_string();
let value = "world".to_string();
database.write(key.as_bytes(), value.as_bytes()).unwrap();
let result: Option = database.read(key.as_bytes()).unwrap();
```## Benchmark
For the benchmark:
- every write is pushed to the operating system, but does not wait for the write to reach the disk.
- Keys are 16 bytes each. Value are 100 bytes each```
random write 5590 ns/ops 178890.877 ops/s
random read 6147 ns/ops 162680.983 ops/s
load 202675.314 records/s
```Enable mmap for read:
```
random read 1797 ns/ops 556483.027 ops/s
```