lattice_maps

Last-writer-wins and observed-remove CRDT maps for Gleam.

Use this package when replicas need key/value data that can be merged without coordination. lww_map stores string values with timestamp conflict resolution; or_map stores nested CRDT values with observed-remove key semantics.

Installation

gleam add lattice_maps

Quick example

import lattice_maps/lww_map
pub fn main() {
let map =
lww_map.new()
|> lww_map.set("status", "draft", 1)
|> lww_map.set("status", "published", 2)
lww_map.get(map, "status")
// -> Ok("published")
}

Modules

ModulePurpose
lattice_maps/lww_mapLast-writer-wins map for string keys and string values.
lattice_maps/or_mapObserved-remove map whose values are nested CRDTs.
lattice_maps/crdtTagged union and specs used by or_map to store heterogeneous CRDT values.

Notes

License

MIT