Skip to content

kottesh/bitdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bitdb

What this tool is

bitdb is a Bitcask-style key-value store in Rust.

  • append-only data files
  • in-memory keydir for latest key position
  • tombstone delete model
  • startup rebuild from data/hint files
  • serial merge compaction
  • CLI operations + benchmark commands

Use it for simple durable key-value workflows, local testing, storage experiments.

Operations you can perform

All examples run from repo root.

Build and run

cargo build
cargo run -- --help

Put a key

cargo run -- --data-dir ./data put user:1 alice

Expected output:

OK

Get a key

cargo run -- --data-dir ./data get user:1

Expected output when found:

alice

Expected output when missing:

NOT_FOUND

Delete a key

cargo run -- --data-dir ./data delete user:1

Expected output:

OK

Show stats

cargo run -- --data-dir ./data stats

Example output:

live_keys=10 tombstones=3

Run merge (compaction)

cargo run -- --data-dir ./data merge

Expected output:

OK

Run CLI benchmarks

Startup benchmark:

cargo run -- --data-dir ./bench-data bench startup --mode serial

Output shape:

startup_ms=...

Merge benchmark:

cargo run -- --data-dir ./bench-data bench merge --mode serial

Output shape:

merge_ms=...

Workload benchmark:

cargo run -- --data-dir ./bench-data bench workload --ops 5000 --mode serial --threads 1

Output shape:

ops_per_sec=...

Run criterion benchmarks

cargo bench --bench engine -- --sample-size 10

Baseline serial numbers tracked in BENCHMARK_BASELINE.md.

Dev quality commands

cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets --all-features

Single test examples

cargo test --test record
cargo test --test merge
cargo test cli_put_get_delete_flow -- --exact

About

Bitcask-style KV store in Rust

Resources

Stars

Watchers

Forks

Contributors

Languages