The Embedded
Event Store
Zero-copy event storage with sub-microsecond reads and 1M+ events/sec batch writes.
$ cargo add varvedb
Built for Speed and Reliability
Zero-Copy Reads
Leverages rkyv to map data directly from disk. No deserialization means reads complete in nanoseconds.
Batch Writes
Achieve 700x throughput gains by batching events. Single transaction overhead amortized across thousands of events.
Append-Only Log
Immutable event stream ensures data integrity and simplifies replication. Perfect for Event Sourcing and CQRS.
Async Notifications
Optional runtime-agnostic notifications let async readers await new commits efficiently without polling (no Tokio required).
Architecture
Memory-mapped storage for maximum throughput. Built on LMDB for ACID guarantees.
User Application
Zero-Copy Read / Batch Append
VarveDB Engine
Stream Handler
Index Manager
Page Cache
mmap / fsync
LMDB / Disk
src/main.rs
use varvedb::{Varve, StreamId};
fn main() -> Result<(), Error> {
// Initialize the event store
let mut varve = Varve::new("./data")?;
// Create a typed stream
let mut stream = varve.stream::<Event, 256>("orders")?;
// Append events (zero-copy on read)
let (seq, _) = stream.append(StreamId(1), &event)?;
// Read back instantly
let bytes = stream.get_bytes(StreamId(1), seq)?;
Ok(())
}