Skip to main content

Crate spacedb_consistency

Crate spacedb_consistency 

Source
Expand description

§spacedb-consistency — SpaceDB Layer 3 (consistency tiers)

Consistency is a per-field choice, declared in the schema, because in a partition-prone world one global setting is always wrong. Three tiers:

  • Tier::Convergent — CRDT, the default: always available, auto-merging.
  • Tier::Causal — session read-your-writes / monotonic reads via a CausalSession, cheap and partition-tolerant, no consensus.
  • Tier::Strong — linearizable, a quorum that fails safe under partition (M7-S2).

And the honesty contract: every op returns the Outcome it actually achieved — Committed{tier} / Local / Stale{lag} / Unavailable{reason} — so an app can never mistake a local-only write for a durable one or a lagging read for a current one.

M7-S1 ships the tier annotations, the honesty contract, and the Causal+ tier; the Strong quorum tier is S2. Open-core (MIT).

Structs§

CausalSession
A causal-consistency session over one or more replicas of a document.
ConsistencySchema
Which tier each field is served at; everything defaults to Tier::Convergent.
QuorumGroup
A quorum of members holding versioned registers for strong-tier keys.

Enums§

Outcome
The consistency a read or write actually achieved.
RejectReason
Why a strong op was refused by the invariant (the quorum was reached).
StrongResult
The result of a strong op. Committed/Rejected mean the quorum was reached and gave a definitive, linearizable answer; Unavailable means it was not reached and nothing was committed.
Tier
The consistency a field is served at.
UnavailableReason
Why a (strong) op could not be served.