lattice
Conflict-free replicated data types (CRDTs) for Gleam, with property-based tested merge semantics.
Convergence notebook
Local updates, deterministic merges, one shared value.
lattice gives each replica a CRDT state it can update independently. When replicas meet, merge uses the CRDT's lattice rule so every node converges without locks, consensus, or a conflict-resolution callback.
ReplicaLocal updateMerged value
node-a
+2max(a:2, b:3)node-b
+3max(a:2, b:3)Every replica reads5
Choose the shape of your state.
Start from the data you need to replicate, then install the smallest package that carries that merge rule.
TotalCounters
lattice_counters for values that only grow, or grow and shrink.Single valueRegisterslattice_registers for last-writer-wins or multi-value conflicts.MembershipSets + presencelattice_sets and lattice_presence for collections and live membership.Nested stateMaps + textlattice_maps, lattice_sequence, and lattice_text for keyed or ordered data.