Storage mode
In one line: a per-component, design-time choice of memory layout and ACID guarantees —
Versioned,SingleVersion, orTransient.
Set on the [Component] attribute and fixed for a given (component name, revision) — to change the mode, bump the [Component] revision; re-using the same revision with a different mode throws InvalidOperationException on reopen. Because it lives on the component type, one archetype freely mixes all three. The mode decides whether MVCC/isolation exists at all — and what a write costs.
| Mode | Isolation | Durability | Write cost (Zen 4) |
|---|---|---|---|
Versioned (default) |
snapshot isolation, MVCC history | zero loss, full ACID | ~250 ns |
SingleVersion |
none — live, last-writer-wins | ≤ 1 tick loss (tick-fence WAL) | ~40 ns |
Transient |
none — live | none — heap only, gone on crash | ~40 ns |
Measured on Ryzen 9 7950X (Zen 4), .NET 10 Release, hot cache. A
Versionedwrite is ~6× a fast-mode write (copy-on-write: allocate a chunk, copy the value, append a revision, stamp a TSN); reads follow suit — ~80 ns vs ~15 ns (~5×).
📌
Committedis not a fourth mode. It is theCommitdurability discipline layered on the byte-identicalSingleVersionlayout — commit-time, zero-loss, atomic durability without a revision chain.
How it relates
- Snapshot isolation — only
Versionedprovides it. - Durability — mode & discipline — the
Commitdiscipline applies only to theSingleVersionlayout. - Transaction — what "transactional" guarantees per mode.
- Tick fence — where
SingleVersiondurability is realised. - Cluster storage — the implicit consequence: one
SingleVersion/Transientcomponent flips the whole archetype to clustered SoA (~50× faster bulk iteration).
In the API
StorageMode— the enum (Versioned/SingleVersion/Transient), set via[Component(StorageMode = ...)].DurabilityDiscipline— the SingleVersionTickFence⇄Commitescalation.
Learn & use
- Narrative: Guide ch.2 §2 — the decision that matters most
- Reference: Isolation & durability cheat sheet
- Feature detail: Storage modes — Versioned · SingleVersion · Transient · Committed