3 releases
| new 0.1.2 | Nov 6, 2025 |
|---|---|
| 0.1.1 | Nov 5, 2025 |
| 0.1.0 | Nov 4, 2025 |
| 0.0.1 |
|
#149 in Database implementations
Used in 3 crates
19KB
135 lines
ministore
Minimal WAL engine for durable, replayable event logging
Part of the mini-rs embeddable toolkit
ministoregives you just enough: atomic, durable, human-readable WAL with zero hidden machinery.
🎯 Purpose
ministore is a Write-Ahead Log (WAL) engine that guarantees every record you write is:
- ✅ Atomic — written entirely or not at all.
- ✅ Durable —
fsynced to disk before the call returns. - ✅ Replayable — readable back in exact order.
- ✅ Human-readable — stored in JSONL format.
It is not a state manager — just a reliable log. You define the record type and apply it to your state.
Perfect for:
- Event sourcing and state machines
- Metadata stores (e.g., in Arcella)
- Local queues, caches, or audit logs on edge/IoT devices
📦 Quick Start
[dependencies]
ministore = "0.1"
serde = { version = "1.0", features = ["derive"] }
use ministore::MiniStore;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct Set { value: u32 }
// Write
let mut store = MiniStore::open("state/journal.jsonl").await?;
store.append(&Set { value: 42 }).await?; // fsync guaranteed
// Replay
let records: Vec<Set> = MiniStore::replay("state/journal.jsonl").await?;
💡 Journal format:
// MINISTORE JOURNAL v0.1.0 {"Set":{"value":42}}
✅ Guarantees
| Property | Guarantee |
|---|---|
| Durability | After append().await, data survives crashes and power loss. |
| Atomicity | Each record is one valid JSON line — no partial writes. |
| Ordering | Records replay in exact append order. |
| Format | Human-readable JSONL + magic header for validation. |
🧩 Part of mini-rs
ministore— durable WAL engine (this crate)minisnap— snapshotting & log compactionministate— ready-to-use state manager (built onministore+minisnap)miniqueue— local durable message queue
Used in:
📄 License
Dual-licensed under:
- Apache License 2.0
- MIT License
Choose the one that best fits your project.
ministore— because if your data matters, it must survive a crash.
Part of themini-rsfamily: simple, embeddable, reliable.
Dependencies
~2.6–6.5MB
~117K SLoC