toondb-storage

Crates.iotoondb-storage
lib.rstoondb-storage
version0.3.4
created_at2026-01-01 03:41:37.255825+00
updated_at2026-01-08 05:52:33.385685+00
descriptionToonDB storage engine (WAL, block store, compaction, sync-first I/O)
homepagehttps://toondb.dev
repositoryhttps://github.com/toondb/toondb
max_upload_size
id2015707
size2,570,351
Sushanth Reddy (sushanthpy)

documentation

https://docs.toondb.dev

README

toondb-storage

High-performance storage engine for ToonDB with ACID transactions and crash recovery.

Overview

toondb-storage provides the persistence layer for ToonDB, featuring:

  • Write-Ahead Logging (WAL): Durable writes with crash recovery
  • MVCC Transactions: Snapshot isolation for concurrent access
  • Columnar Storage: 80% I/O reduction via projection pushdown
  • Memory-Mapped I/O: Zero-copy reads for maximum throughput

Features

  • ACID Transactions: Full transactional guarantees with rollback support
  • Crash Recovery: Automatic recovery from WAL after unexpected shutdown
  • Batch Writes: Group commit for high write throughput
  • Compaction: Background compaction to reclaim space
  • FFI Layer: C-compatible FFI for Python/Node.js bindings

Installation

[dependencies]
toondb-storage = "0.2.5"

Usage

Most users should use the high-level toondb crate:

use toondb::Database;

let db = Database::open("./my_data")?;

// Transactional writes
let txn = db.transaction()?;
txn.put("users/1", b"Alice")?;
txn.commit()?;

Architecture

┌─────────────────────────────────────────┐
│           toondb-storage                │
├─────────────────────────────────────────┤
│  Transaction Layer (MVCC, Isolation)    │
├─────────────────────────────────────────┤
│  WAL (Write-Ahead Log, Durability)      │
├─────────────────────────────────────────┤
│  Page Cache (Buffer Pool, LRU)          │
├─────────────────────────────────────────┤
│  Storage Engine (LSM-tree, Compaction)  │
└─────────────────────────────────────────┘

Performance

Operation Throughput
Point reads ~500K ops/sec
Sequential writes ~200K ops/sec
Batch writes (1000) ~2M ops/sec
Recovery time <100ms for 1GB WAL

Crate Structure

Crate Purpose
toondb High-level client API (start here)
toondb-core Core types and traits
toondb-storage Storage engine (this crate)
toondb-index HNSW vector indexing
toondb-query Query planning and execution

License

Apache-2.0 - see LICENSE for details.

Commit count: 98

cargo fmt