SEP 51: Conflict free editing

I store my files on a filesystem, this site is built from that filesystem. This system works for me, but I am interested in research developments in the area of Optimistic Replication, chiefly the promise of Conflict-free Replicated Data Types.

I’m not interested in a CMS (Content management system) because I spend much of my life ‘offline’, without any internet connectivity. All my workflows are offline-first, with any online component being reached via some method of eventual consistency.

Conflict-free Replicated Data Types, or CRDTs, represent an opportunity to modify documents asynchronously while still reaching eventual state consistency, and without merge conflicts. Currently my notes are edited locally (preferred) and replicated between devices using git. This system of replication is cumbersome when it comes to making modifications from multiple devices. Correcting a typo from my phone has a number of perhaps undesirable pre-requisites:

The file must be edited, saved, committed to the local git repo, pushed to the remote, and then pulled from that remote by my other devices/clients. If simultaneous edits are made then merge conflicts arise and must be resolved manually.

A preferred workflow, particularly for the making of small corrections or edits to documents, would be to be able to edit the ‘live’ document from anywhere, even if I am offline. CRDTs permit this.

For example, an authenticated instance of a CRDT editor (styled after Anno perhaps) could be made available at edit.silasjelley.com. Changes made there would be replicated via CRDT to my other local working copies of files, whether on my laptop, phone, and the web server that hosts the site. In the latter case, such a change would trigger a rebuild of that page.

Codemirror could serve as the editor component of such a flow.

Also of interest in this space is the Dat protocol.