liveBook · Manning

Real-time collaborative editing

As explained in Building User-Friendly DSLs

Concurrent editing in which multiple collaborators modify shared content and observe one another’s changes while working.

Real-time collaborative editing lets multiple collaborators edit shared content simultaneously from different devices. A client-server design sends each edit immediately to a central server, which broadcasts it so all clients synchronize. section 10.1

A typical synchronization flow is:

  • Capture a collaborator’s local edit, usually a small change such as a few keystrokes. section 10.1
  • Send the change immediately to the central server. section 10.1
  • Check the change against the current shared content before broadcasting it. section 10.1
  • Broadcast compatible changes to collaborators and update their content. section 10.1
  • Roll back a conflicting local change and redo it against the synchronized content. section 10.1

Concurrent edits under network latency

Two collaborators edit the same shared content before either receives the other’s change. The server detects the conflict, withholds the conflicting update from the other collaborators, and rolls back the originating change. Because edits are usually small, the lost work is limited and can be redone against the synchronized content. section 10.1

This synchronous style complements asynchronous distributed version control: real-time editing shares changes as work happens, whereas commit sequences accumulate changes before merging. Projectional editing can further represent DSL content changes as small deltas on an abstract syntax tree. section 10.1 section 10.4

How Building User-Friendly DSLs covers it

How deep it goes
Explains client-server synchronization, latency conflicts, rollback, and redo, but does not specify a conflict-resolution algorithm.
Examples
Uses Google Docs, multi-device shared content, keystroke-sized edits, and copying, cutting, pasting, shuffling, or deleting.
What you can do after
Evaluate synchronous collaboration by tracing change transmission, conflict checks, broadcasting, rollback, and redo.
How it connects
Contrasts with distributed version control and connects to projectional editing, abstract syntax trees, network latency, and merge conflicts.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building User-Friendly DSLs. The section links point to the parts of the book it draws on.