Talk 27:00

CRDTs and the BEAM: Eventual Consistency Through Acronyms

Conflict-free Replicated Datatypes (CRDTs) allow for distributed, p2p-style workflows where users generate data without conflicts. At screen.garden we wrap Yjs, a CRDT, inside a NIF to push business logic down into clients. This pairs surprisingly well with the BEAM, as we can manage those CRDTs inside stateful processes to turn a fundamentally imperative data structure into a functional one. Adding Phoenix for pubsub and LiveView, we use this architecture to create screen.garden, a collaboration and sync platform for Obsidian. All of this allows for fine-grained sync between a server and many devices, without conflicts and without fear of downtime.