spacedb-store 0.1.0

SpaceDB Layer 0 — the per-node storage primitive: an engine-agnostic, transactional, order-preserving typed key/value store (redb + in-memory engines) that everything in SpaceDB rests on. Phase 1 SpaceDB Mission, M1 / Slice 1. See 'docs/plans/(working) phase 1 spacedb mission.md'.
Documentation

spacedb-store — SpaceDB Layer 0

The per-node storage primitive: a typed, transactional, order-preserving key/value store that everything else in SpaceDB rests on. Getting this small and correct is the whole game — every layer above inherits its guarantees.

What S1 ships

  • [KvEngine] — the engine seam, with two implementations that share identical transaction semantics: [RedbEngine] (durable) and [MemEngine] (in-memory, for tests).
  • [codec] — a deterministic postcard value codec and an order-preserving key codec (a < b ⟺ encode(a) < encode(b)), each a verified bijection.
  • [Table] — the typed Table<K, V> primitive that applies both codecs once so layers above never touch raw bytes.

Guarantees

  • Atomic multi-table writes. One [WriteTx] spans many tables and commits all-or-nothing; dropping it rolls back.
  • Logical-order range scans, courtesy of the order-preserving key codec.
  • Single-writer / snapshot reads, identical across both engines.

Open-core boundary

spacedb-store is MIT and depends on no MATA crate. MATA-specific capabilities (the vault key, identity, mesh replication, settlement) enter later through seams this crate defines — e.g. the KeyProvider for the AEAD boundary in S2 — which MATA implements in its proprietary hosted product. The dependency arrow is MATA → SpaceDB, never the reverse.