Expand description
§spacedb-crdt — SpaceDB Layer 1 (convergent collections)
The default data tier, and the reason SpaceDB survives a partition-prone mesh:
data is modeled as Y-CRDT (via yrs), so every write is locally available
and merges conflict-free with no coordination. Writing offline on a
Starlink-partitioned home is a non-event, not an error.
M2-S1 ships CrdtDoc: a document with a typed field→CRDT-type mapping
(LWW-Register + PN-Counter), local-first mutation, and the sync primitives
(state vector, incremental update, merge). The order-independent convergence
property — the same updates in any order produce the same state — is proven
by the fuzzed test in tests/convergence.rs.
Open-core (MIT): this depends on yrs directly, never on a MATA crate.
Persistence into the encrypted spacedb-store is M2-S2.
Structs§
- CrdtDoc
- A convergent document: a yrs CRDT plus a typed field API.
- Crdt
Store - Persists
CrdtDocs into an encryptedspacedb-storecollection. Engine- agnostic like the underlyingCollection: the methods take the engine and open their own transactions. - Reactive
Query - A live query over a document: re-evaluates
querywhen the document changes and yields the new result only when it differs from the last emitted one. - Watcher
- Watches a document’s revision counter for changes.
Enums§
Constants§
- CRDT_
DOCS_ COLLECTION - The encrypted collection that holds
doc_id → CRDT-staterows.
Functions§
- compact_
updates - Merge a batch of v1-encoded updates into one compacted, equivalent update.
Type Aliases§
- Crdt
Result - Result alias for
spacedb-crdt.