Real-time collaboration, briefly
PublicYou and a teammate open the same Glyph document. You move a node. They see it move. They drag a sticky note over yours. You both see the conflict resolve — the sticky lands where the last edit said it should, and nobody’s arrow disappears. Nobody saved anything; nothing is “merging” in the background. It just stays in sync.
That is the user-facing story. The implementation is a CRDT (Yjs), a WebSocket per document, a per-user awareness channel for cursors and selections, and an IndexedDB layer that buffers your edits when the connection drops so you can keep working offline. Reconnect and the buffer flushes; the document re-converges with whatever happened on the server in the interim.
What this buys you
Section titled “What this buys you”- No save button. Edits replicate continuously.
- Offline-tolerant. A flaky train Wi-Fi does not lose your work.
- Conflict-free. Two people editing the same node parameter at the same instant do not “race” — the CRDT defines a winner.
- Comments and drawing don’t compete with the graph. The four subdoc model (see the three document modes) means a heavy stream of pen strokes does not block executable-graph edits.
What it does not buy
Section titled “What it does not buy”- Not a substitute for permissions. Permissions are bitwise (read / write / admin); see Permission bits.
- Not eventual consistency in the sloppy sense. Yjs is strongly eventually consistent — both clients converge on the same byte-for-byte state once they have seen the same updates.
- Not a content delivery network. Real-time replication is between collaborators of one document; assets live in MinIO and load on demand.
If you want the engineering story, Yjs in production and Rooms, presence, backpressure cover the implementation honestly.