| Crates.io | bitask |
| lib.rs | bitask |
| version | 0.1.1 |
| created_at | 2025-01-22 09:39:54.877276+00 |
| updated_at | 2025-01-22 10:05:02.110647+00 |
| description | Bitask is a Rust implementation of Bitcask, a log-structured key-value store optimized for high-performance reads and writes. |
| homepage | |
| repository | https://github.com/vrnvu/bitask |
| max_upload_size | |
| id | 1526456 |
| size | 76,647 |
Bitask is a Rust implementation of Bitcask, a log-structured key-value store optimized for high-performance reads and writes. Here's the summary in 10 lines:
https://riak.com/assets/bitcask-intro.pdf
This implementation provides:
Vec<u8>) are supported for keys and valuesuse bitask::db::Bitask;
// Open database with exclusive write access
let mut db = Bitask::open("./db")?;
// Store a value
db.put(b"key".to_vec(), b"value".to_vec())?;
// Retrieve a value
let value = db.ask(b"key")?;
assert_eq!(value, b"value");
// Remove a value
db.remove(b"key".to_vec())?;
// Manual compaction
db.compact()?;
// Process safety demonstration
let another_db = Bitask::open("./db");
assert!(matches!(another_db.err().unwrap(), bitask::db::Error::WriterLock));
<timestamp>.active.log - Current file being written to<timestamp>.log - Immutable files after rotationdb.lock - Ensures single-writer access.active.log becomes .log and new .active.log is created