sochdb-storage

Crates.iosochdb-storage
lib.rssochdb-storage
version0.4.3
created_at2026-01-12 17:08:13.492983+00
updated_at2026-01-23 20:32:46.703092+00
descriptionSochDB storage engine (WAL, block store, compaction, sync-first I/O)
homepagehttps://sochdb.dev
repositoryhttps://github.com/sochdb/sochdb
max_upload_size
id2038215
size2,708,750
Sushanth Reddy (sushanthpy)

documentation

https://sochdb.dev

README

sochdb-storage

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

Overview

sochdb-storage provides the persistence layer for SochDB, 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]
sochdb-storage = "0.2.5"

Usage

Most users should use the high-level sochdb crate:

use sochdb::Database;

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

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

Architecture

┌─────────────────────────────────────────┐
│           sochdb-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
sochdb High-level client API (start here)
sochdb-core Core types and traits
sochdb-storage Storage engine (this crate)
sochdb-index HNSW vector indexing
sochdb-query Query planning and execution

License

Apache-2.0 - see LICENSE for details.

Commit count: 121

cargo fmt