Skip to main content

Module backend

Module backend 

Source
Expand description

Bytes-level kv backend (Phase 14.6 — DS-14-storage L1, M4.B 2026-05-10).

One responsibility: read/write byte ranges under string keys. Tier specializations (tier.rs, memory.rs) layer typed serialization on top via Codec.

All operations are sync (D143 — pre-Q1 lock). Backends that need async I/O (network, tokio::fs) wrap their async surface in tokio::Handle::block_on at the call site, or expose a sync facade via spawn_blocking. The memory backend in this module is fully sync.

Structs§

MemoryBackend
In-memory bytes backend backed by parking_lot::Mutex<HashMap<String, Vec<u8>>>. All operations are synchronous and in-process. Useful for tests, hot tiers, and as the default backend for the memory_* convenience factories.

Traits§

StorageBackend
Bytes-level kv backend. Tiers layer typed serialization on top via Codec.

Functions§

memory_backend
Convenience constructor returning an Arc<MemoryBackend>. Use this when sharing a single backend across multiple tiers (the paired { snapshot, wal } pattern from DS-14-storage §a).