osmiumdb

Crates.ioosmiumdb
lib.rsosmiumdb
version0.1.0
created_at2026-01-06 01:59:53.302868+00
updated_at2026-01-06 01:59:53.302868+00
descriptionA dense, chunk-oriented database engine with explicit hot/cold memory control
homepage
repositoryhttps://github.com/YelenaTor/osmiumdb.git
max_upload_size
id2024951
size359,184
YoruXIII (YelenaTor)

documentation

README

OsmiumDB

A dense, chunk-oriented storage engine with explicit hot/cold memory control.

License: MPL 2.0 Rust


What is OsmiumDB?

OsmiumDB (OSDB) is an embedded key-value storage engine designed for workloads that need:

  • Zero-copy reads — Borrow directly from chunk buffers, no allocations on the hot path
  • Explicit memory control — Chunks are either awake (in memory) or sleeping (on disk)
  • Columnar support — Fixed-width numeric columns for efficient scans and aggregations
  • Crash recovery — WAL-based durability with idempotent replay

Quick Start

use osmiumdb::{Engine, EngineConfig};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = EngineConfig::new("./my_db");
    let engine = Engine::open(config)?;

    // Write
    engine.put(b"hello", b"world")?;

    // Read
    if let Some(value) = engine.get(b"hello")? {
        println!("Got: {}", String::from_utf8_lossy(&value));
    }

    // Scan
    for (key, value) in engine.scan(b"a"..b"z")? {
        println!("{:?} = {:?}", key, value);
    }

    Ok(())
}

Features

Feature Description
Chunk-based storage Data organized into immutable 64MB chunks
Zero-copy views RowRecordView<'a> borrows from backing buffer
mmap support Optional memory-mapped I/O via --features mmap
Compaction Merge chunks, reclaim deleted keys
WAL durability Write-ahead log for crash recovery
Columnar veins Efficient numeric column storage

Installation

Add to your Cargo.toml:

[dependencies]
osmiumdb = "0.1"

For mmap support:

[dependencies]
osmiumdb = { version = "0.1", features = ["mmap"] }

Performance

Benchmarks on 10,000 records (32-byte keys, 256-byte values):

Operation Allocating Zero-Copy Speedup
Full Scan 1.6ms 213μs 7.6x
Point Lookup 748μs 140μs 5.3x
Memory/Scan 3.4MB 48 bytes 70,000x

Documentation

  • TECHNICAL.md — Architecture, internals, and design decisions
  • ENCODE.md — Binary format specification

License

This project is licensed under the Mozilla Public License 2.0.

Author

Created by @YelenaTor27021


OsmiumDB — Dense storage for dense workloads.

Commit count: 0

cargo fmt