Tristan Peralta
Diagram of two tree replicas converging through operations

Libraries 2026

Grove

Conflict-free replicated trees for Elixir.

Grove is a CRDT library for tree-shaped data: documents, syntax trees, nested outlines, and anything else where two people can edit the same structure at once. It is operation-based, so replicas exchange edits rather than documents.

Trees are the hard case

Counters and registers are solved problems. Trees are not: a move can create a cycle, a concurrent delete can orphan a subtree, and a naive implementation pays a large metadata cost on every keystroke. Grove handles moves without ever producing a cycle, keeps deleted nodes as tombstones only as long as they are needed, and includes local undo/redo stacks so an editor does not have to rebuild them.

The Eg-walker optimization is the part that matters in practice: for sequential editing — the common case — the CRDT overhead is close to zero, and the full machinery only engages when concurrent operations actually conflict.

The schema layer

Fields are typed. A schema declares which CRDT each field uses (last-writer-wins, multi-value, observed-remove set, RGA list, counter), and migrations move existing documents forward. Applications can keep plain maps or JSON in the database and convert to a CRDT only when a session needs to sync, which keeps storage and reporting simple.

On the BEAM

Grove runs in one node or across a cluster; presence and operation fan-out use :pg. Phoenix LiveView integration is built in, so a collaborative editor can subscribe replicas to a session and let the server own convergence. Fermata, a collaborative notation editor, uses it to keep scores in sync.

Grove is published on Hex as grove.