Skip to content

Collaborative text

Three independent replicas of one paragraph, side by side. Type into any of them and watch it appear in the others; take one offline, edit all three, bring it back, and watch a genuine divergence be reconciled without anybody losing a word.

Three replicas, one document

Below are three independent replicas of the same document, demo-text. Nothing is shared between them except the messages they send each other.

Opening three replicas…

The thing worth trying. Take Replica A offline with its Go offline button. Type a sentence into it. Now type different sentences into B and into C - note that those two still see each other, because only A left. Then bring A back online. All three converge on a document containing every sentence, in the same order in all three panels. Nothing was locked, nothing was queued keystroke by keystroke, and nothing was overwritten. Without a CRDT, the usual outcome here is that whichever replica saved last wins and the other two sentences are gone.

What a keystroke becomes

Each panel has its own client identifier, its own presence identity, its own local storage and its own connection to the in-memory network the other two are on, which is why what you see is a real demonstration rather than three views of one variable.

Type into any panel. The edit is turned into the minimal insertion or deletion you actually made - not "the textarea now says this", which would replace every character and destroy concurrent work - encoded as a delta of a few bytes, sent, decoded, merged, and rendered in the other two. The coloured bar of each panel is that replica's presence colour, and it is the same colour its collaborators show next to its name in their own presence lists.

An unhandled error has occurred. Reload 🗙