Open source ยท MIT or Apache-2.0

Nexir MVCC

nexir-mvcc is a standalone, deterministic Rust library for versioning, intents, guarded writes, atomic batches, and history retention. Nexir uses it as part of the database's storage stack.

Clear boundary

A library, not the Nexir database.

The core owns deterministic MVCC semantics. Adapters own durability, crash atomicity, scheduling, consensus, command parsing, metrics, and network services.

Versioned reads

Caller-supplied logical timestamps select the visible committed version.

Intent transactions

Prewrite, commit, and abort single- or multi-key write sets.

Guarded fast paths

Apply direct or compare-and-swap guarded batches in one round trip.

Atomic batches

Backend contracts cover all-or-nothing write sets and deterministic ordering.

Incremental GC

Retain history with caller-controlled safe points, cursors, and work budgets.

Conformance suite

Test custom backend implementations against the logical contract.

Use independently

Bring your own backend.

  1. Implement the Backend trait for your storage engine.
  2. Wrap it in MvccEngine.
  3. Serialize mutation application for each ordered write domain.
  4. Map your external reads and mutations to engine operations.
  5. Run the conformance suite plus adapter-specific crash tests.
use nexir_mvcc::{
  InMemoryBackend, MvccEngine,
  PhysicalWrite, Timestamp,
};

let mut db = MvccEngine::new(
  InMemoryBackend::new()
);

db.apply_direct_batch(
  Timestamp(10),
  vec![PhysicalWrite {
    key: b"config".to_vec(),
    value: Some(b"v1".to_vec()),
  }],
)?;

let value = db.read(b"config", Timestamp(15))?;

Build and test

git clone https://github.com/nexirdb/nexir-mvcc-core.git
cd nexir-mvcc-core
cargo test --all-features
cargo doc --no-deps --all-features

Current crate requirements: Rust 1.91 and edition 2024. The library is published on crates.io as nexir-mvcc from the nexir-mvcc-core repository; Nexir 0.1.0-beta.3 ships nexir-mvcc 0.3.0.

License

The repository declares MIT OR Apache-2.0, at the user's option, with both license texts and Apache notice information included.

This open-source license applies to the nexir-mvcc crate, not to the complete Nexir database binary.

Product hierarchyNexir is the complete distributed database delivered as a free downloadable binary during public beta. Nexir MVCC is the separate open-source library used within its technology stack.