| Crates.io | shorterDB |
| lib.rs | shorterDB |
| version | 0.2.0 |
| created_at | 2025-05-14 20:45:33.585997+00 |
| updated_at | 2026-01-10 08:43:18.647482+00 |
| description | A lightweight embedded key-value store built with SkipLists and LSM architecture |
| homepage | |
| repository | https://github.com/Hrefto/shorterdb |
| max_upload_size | |
| id | 1673956 |
| size | 55,723 |
A high-performance, embedded key-value store for Rust, built with a Log-Structured Merge-Tree (LSM-Tree) architecture.
get, set, and delete interface.Add this to your Cargo.toml:
[dependencies]
shorterDB = "0.2.0"
use shorterdb::ShorterDB;
use std::path::Path;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open the database (creates directory if missing)
let mut db = ShorterDB::new(Path::new("/tmp/my_db"))?;
// Store a key-value pair
db.set(b"username", b"ferris")?;
// Retrieve the value
if let Some(value) = db.get(b"username")? {
println!("Found user: {}", String::from_utf8_lossy(&value));
}
// Delete the key
db.delete(b"username")?;
Ok(())
}
ShorterDB uses a classic LSM-Tree design with a Memtable, Write-Ahead Log, and background Flusher.
For deep technical details on the internal design, file formats, and ACID guarantees, see ARCHITECTURE.md.
The project workspace includes examples you can run locally:
# Basic embedded usage
cargo run -p examples --bin embedded
# Interactive REPL
cargo run -p examples --bin repl
Licensed under either of Apache License, Version 2.0 or MIT license at your option.