Skip to main content

Module crdt

Module crdt 

Source
Expand description

CRDT semantics for collaborative metadata (SSoT: Metadata — Collaborative Metadata).

User-editable fields on a shared album (tags, captions, ratings) can be edited concurrently across devices, including offline. They are modelled as CRDTs so merges are deterministic and commutative:

  • or_set::OrSet — tags, with add_id binding and reject-unobserved-remove.
  • lww::Lww — single-value registers (caption, rating) with a superseded log.
  • counter::Counter — the per-device monotonic add_id counter.

Structs§

AddId
A per-device, per-(asset, OR-set) monotonic add identifier.
Counter
A monotonic counter issuing add_ids for one device.
Lww
An LWW register that also retains displaced values, newest-superseded first.
OrSet
An observed-remove set of T.
Stamped
A timestamped, device-attributed value.
UnobservedRemove
A remove targeted an add_id that was never observed locally as an add.

Constants§

SUPERSEDED_CAP
Default cap on the superseded log (see Metadata: superseded_captions ≤ 16).