Designing a Real-Time Collaborative Editor
A Google Docs–style collaborative editor is really a synchronization platform: persistent connections, authoritative document ownership, conflict resolution, presence broadcasting, version history, offline recovery, and sharding that lets many people edit the same document without diverging.
Problem Definition
We need to design a collaborative editing platform where many users can type into the same document at the same time and all clients converge on one shared result without losing edits or blocking every keystroke behind a full page save.
A single-writer document editor is mostly a local-state problem: keep an Editor Client buffer, autosave to storage, and restore history when needed. A real-time collaborative editor is different because multiple Editor Client instances can mutate the same logical document concurrently, often over unreliable networks and with different local views of time.
Why this system is architecturally hard
The platform must accept local edits instantly, preserve the user's typing feel, replicate operations through a WebSocket Gateway, route them to the correct Document Server, reconcile concurrency inside a Synchronization Engine, broadcast updates back through a Pub/Sub Broadcast Layer, persist durable state in a Document Store and Version Store, and recover when clients disconnect and later reconnect. The interesting question is not 'can a text box save text?' but 'how does the system keep many replicas converged under latency, failure, and scale?'
Three experiences the editor must satisfy at once
A production-shaped design is really satisfying three distinct experiences simultaneously, not one: local responsiveness (a keystroke should feel instant, regardless of network conditions), shared convergence (every collaborator's client should eventually agree on the same document state), and durability (an edit that the system reports as saved should survive failure according to the design's durability contract). Treating these as one undifferentiated goal is what leads to ambiguous acknowledgement semantics later in the design.
Visual Design Journey
Watch one shared document evolve from a single local editor into a real-time convergence platform — live WebSocket transport, operational transform, presence, offline replay, and sharded document ownership, earned one bottleneck at a time.
Functional Requirements
Functional requirements define what the collaboration platform must do for editors, viewers, and downstream systems.
Real-time shared editing
Multiple Editor Client instances should send insert, delete, format, and replace operations and see remote updates appear quickly without full-document refreshes.
Persistent connection management
The platform should maintain a long-lived connection through a WebSocket Gateway so edits, cursor moves, acknowledgements, and heartbeats can flow continuously.
Conflict Resolution
Concurrent edits must be reconciled by a Synchronization Engine using Operational Transform (OT) or a CRDT strategy so all replicas converge instead of clobbering one another.
Presence and cursors
Users should see who is online, where named cursors are, what selections are active, and when collaborators join or leave, all via a dedicated Presence Service.
Version history and restore
The system should preserve revision checkpoints in a Version Store so a document can be inspected or restored without replaying every edit manually from the UI.
Offline editing and resync
A disconnected client should continue collecting edits in an Offline Queue, then perform Reconnection & Resync later without discarding local work.
Access control and sharing
The platform needs an owner/editor/commenter/viewer permission model, and must enforce authorization consistently for opening a document, editing it, commenting on it, viewing its history, sharing it further, and restoring a prior revision. This is a functional requirement, not a full identity-and-access-management tutorial — the point is that every one of those actions is a distinct capability that can be granted or revoked independently.
Document lifecycle
Documents move through a lifecycle beyond raw editing: create, rename, open, edit, share, and delete/restore. Lifecycle state (for example, a deleted-but-recoverable document) affects what the collaboration path should allow.
Optional collaboration features
Comments and suggestion mode are worth naming as optional scope extensions, because they have different data semantics from plain text edits — a comment is closer to a small structured record than an in-place mutation, and a suggestion is a proposed change rather than an accepted one (see Comments & Suggestion Mode in Architecture Deep Dive).
Non-Functional Requirements
A collaborative editor is judged as much by feel and resilience as by correctness.
Low perceived latency
The local editor applies keystrokes immediately via optimistic local editing, while remote propagation through the collaboration path targets low latency. Any specific millisecond figure here is an illustrative budget for this design, not a measured or universal production number, and it is not a claim about any specific real product's internals.
Convergence
Given the same set of accepted operations, every healthy replica should eventually produce the same document state, even if operations arrived in different intermediate orders. Convergence describes the eventual, settled state — it does not imply that every transient client state is identical at every instant while operations are still in flight.
Durability
Durability requires defining what "accepted" actually means. A document is not durable merely because an in-memory owner applied an operation — durability means the operation has been recorded according to the design's configured durability policy (see Operation Durability & Acknowledgements in Architecture Deep Dive). Accepted document state, snapshots, and revision history should survive the failures that durability policy is designed to cover.
Ordering
Within a single document, accepted operations need an authoritative order and monotonic version progression for an OT-style centralized design to reconcile correctly. There is no requirement for a single global ordering across unrelated documents — ordering only needs to be authoritative per document.
Availability
Read and edit availability may differ during failures. A safe system may temporarily stop accepting authoritative writes for one affected document rather than risk two divergent authoritative histories — a brief, scoped write pause is preferable to split-brain edits (see Document Owner Lease & Fencing).
Security
Connections must be authenticated, document access must be authorized per-document (not just per-user globally), authorization must be revalidated rather than trusted forever after connect, and the system needs rate limits, message-size limits, and validation of untrusted operation payloads at the trust boundary.
Scalability
The architecture must sustain large numbers of WebSocket Gateway connections, many active documents, hot shared docs, and bursts of edits without central bottlenecks.
Observability
Operators need metrics for connection counts, edit latency, transform failures, queue depth, stale presence, reconnect storms, and shard hotspots — collaboration correctness can fail silently, so these signals matter as much as uptime (see Collaboration Observability in Architecture Deep Dive).
Scope
Good scope discipline keeps this module about collaborative-system architecture, not a feature tour or a formal algorithms lecture.
In scope
The Editor Client sync path, WebSocket Gateway, Document Server, Synchronization Engine, Operation Queue, Presence Service, Pub/Sub Broadcast Layer, Document Store, Version Store, Offline Queue, Shard Router, Reconnection & Resync, and scaling patterns for hot documents and large connection fleets.
Out of scope
Rich-text toolbar features, comments UI, spreadsheet formulas, deep text-editor rendering internals, and mathematical proofs of Operational Transform or CRDT correctness. We explain why those strategies exist and how they fit the architecture, but we do not turn this page into a theorem notebook.
This module frames the exercise as "Google Docs–style" purely as a generic, well-known product shape — a familiar reference point for the kind of editor being designed. It is not a claim about Google's actual, undocumented internal architecture. Where the product shape is discussed (permission tiers, comments, sharing), it is discussed as a plausible feature surface; the architecture itself is presented as one reasonable production design, not as documented fact about any specific company's systems.
Capacity Estimation
Capacity planning for collaborative editing is driven by concurrent documents, editors per document, edit frequency, and the number of open persistent connections. Every figure below is an illustrative assumption for working through the math, not a sourced production measurement.
Traffic assumptions
For an illustrative large-scale design, assume 12 million DAU. If each active user opens 8 documents/day, that is 96 million document sessions/day. 96M ÷ 86,400 ≈ 1,110 document opens/sec average. Collaboration traffic is bursty, so with an 8× peak factor the fleet should handle roughly 8,900 document opens/sec peak.
Concurrent editing load
Assume 1.8 million concurrently open documents at busy times and that 15% are actively being edited, giving 270,000 active collaborative documents. If the average active document has 3 live editors, the system manages about 810,000 active editing connections before including passive viewers.
Edit volume — logical operations, not raw keystrokes
Assume an active editor produces 0.8 operations/sec on average across bursts of typing and idle pauses. This is an architectural assumption about accepted operations, not a claim about raw characters typed per second — one operation could be a batched multi-character insert, an IME/composition event, or a structural rich-text operation rather than a single keystroke. 810,000 × 0.8 ≈ 648,000 operations/sec peak entering the collaboration path.
Outbound bandwidth and fan-out
Because every accepted operation fans out to peers, the broadcast layer may emit roughly 648,000 × 2 additional recipients ≈ 1.3 million downstream deliveries/sec for 3-editor documents. This dimension matters far more than the arithmetic itself suggests: broadcasting a small operation to 2 peers is a fundamentally different fan-out problem than broadcasting the same operation to 10,000 viewers on one hot document (see Hot-Document Fan-Out in Architecture Deep Dive) — the exact multiplier matters less than recognizing fan-out as its own scaling dimension, separate from edit volume.
Connection and heartbeat pressure
If total open collaboration-related connections, including viewers and presence-only tabs, reach 3 million WebSocket connections, and each client sends a lightweight heartbeat every 20 seconds, the gateway fleet must absorb about 150,000 heartbeat messages/sec even before user edits are counted.
Storage and history write pressure
If the average durable document body is 60 KB and the system stores 200 million active documents, that is about 12 TB of primary document content before replicas. If a typical actively edited document also keeps 400 operations/day at 150 bytes/op plus periodic snapshots (applying that to all 200 million documents would mean about 80 billion operations/day, so only a fraction of documents can be that active), the Version Store grows quickly. This write pressure depends on several independent knobs — operation size, retention window, snapshot cadence, compression, and compaction frequency — and should be sized against all of them together, not against operation count alone. Illustrative fraction: if 5% of the 200 million documents (10 million) are actively edited on a given day, that is 10M × 400 = 4 billion operations/day × 150 bytes ≈ 600 GB/day of raw operation payload before snapshots, indexes, compression and replication — versus ≈ 12 TB/day if all 200 million were that active, which is why the active fraction, not the stored-document count, drives write volume.
- 01All figures in this section are illustrative assumptions for reasoning through scale, not sourced production numbers.
- 02Collaborative-editing scale is not just storage scale; it is connection scale plus fan-out scale.
- 03Operation rate and broadcast rate differ because one accepted edit often becomes multiple outbound deliveries, and fan-out to a large viewer audience is a distinct scaling dimension from edit volume.
- 04Heartbeat traffic is cheap per message but large in aggregate, which is why the WebSocket Gateway must be treated as infrastructure, not a tiny helper service.
- 05Capacity estimates should separate document opens, live connections, edit operations, broadcast deliveries, and history storage because each tier experiences different pressure.
Collaborative Editor API and Operation Protocol
The API surface is usually a mix of document bootstrap over HTTP and live collaboration over WebSockets.
HTTP bootstrap endpoints (conceptual)
POST /documents creates a document. GET /documents/{docId} fetches metadata and the current materialized body. GET /documents/{docId}/snapshot fetches the latest durable snapshot for bootstrap or resync. GET /documents/{docId}/history browses version history. POST /documents/{docId}/restore restores a prior revision as a new mutation. A sharing/permission mutation endpoint updates the access model. These are illustrative shapes to convey the contract, not a fixed protocol specification.
Bootstrap vs live channel
A client often fetches initial metadata and the latest snapshot first, then upgrades into a persistent socket for edits, presence, acknowledgements, and replay on reconnect. The important contract is message shape: operations need IDs, base versions, author identity, and document routing information so the server can reconcile them safely.
{
"type": "edit_op",
"docId": "doc_842",
"clientId": "client_a7",
"clientSeq": 391,
"sessionId": "sess_19",
"opId": "op_9012",
"baseVersion": 1842,
"ownerEpoch": 27,
"operation": {
"kind": "insert",
"position": 128,
"text": " collaborative"
}
}
{
"type": "cursor_update",
"docId": "doc_842",
"clientId": "client_a7",
"userId": "user_14",
"cursor": {
"anchor": 128,
"focus": 141
},
"color": "#4f46e5"
}
{
"type": "presence_heartbeat",
"docId": "doc_842",
"clientId": "client_a7",
"lastSeenVersion": 1845,
"sentAt": "2026-09-09T10:30:00Z"
}Acknowledgement, remote operations, and resync
An op_ack tells the client its operation reached a specific state — in this design, status: "committed" means the operation has been durably recorded per the durability policy, not merely received (see Operation Durability & Acknowledgements in Architecture Deep Dive).
{
"type": "op_ack",
"opId": "op_9012",
"clientSeq": 391,
"appliedVersion": 1845,
"status": "committed"
}A remote operation description carries the authoritative applied version, the operation ID, the author/client identity, and the transformed or merged payload — clients apply this rather than the sender's original, pre-reconciliation payload. A resync instruction tells the client it is too far behind (a version gap was detected) and should fetch a snapshot and rebase rather than expecting incremental replay.
Error categories
Unauthorized, stale owner/session, invalid operation, resync required, throttled, and temporarily unavailable are distinct categories the client should handle differently rather than treating every rejection as a generic failure. Make idempotency explicit throughout: duplicated opId submissions should not apply twice.
Data Model
Explain the core data model as collaboration entities rather than as raw text bytes alone.
Document
Represents the durable content record in the Document Store: document ID, owner/access-policy reference, current materialized body, current version, shard/owner mapping, latest snapshot version, lifecycle state (active, deleted, restorable), and timestamps.
Operation
Represents one user edit or structural change: operation ID, clientSeq, author, base version, the authoritative applied version once accepted, the owner epoch it was accepted under, operation payload, an operation schema version, and its committed/durability state.
Version Snapshot
Represents a point-in-time revision stored in the Version Store so recovery or restore can start from a checkpoint instead of replaying the entire lifetime log. A snapshot record includes the document ID, its exact document version/revision, the serialized state, a format/schema version, and integrity metadata such as a checksum so corruption can be detected rather than silently trusted.
Editing Session
Represents one connected client session: client ID, user ID, connected gateway, current document, last acknowledged version, and heartbeat state used by presence and reconnect logic.
Document Ownership (conceptual)
A conceptual DocumentOwnership record tracks which server currently owns a document's authoritative write path: docId, ownerShard, epoch, and a lease/expiry (or equivalent). This is a logical entity the design needs — it does not prescribe a specific database or coordination technology to implement it with (see Document Owner Lease & Fencing in Architecture Deep Dive).
Permission
A simple access record — who can view, comment, edit, or manage sharing for a document. This is necessary groundwork for live authorization revalidation and for correctly rechecking access on reconnect, not a full access-control subsystem design (see Authorization in Live Collaboration in Architecture Deep Dive).
{
"docId": "doc_842",
"title": "Launch review",
"currentVersion": 1845,
"shardId": "doc-shard-19",
"ownerEpoch": 27,
"latestSnapshotVersion": 1840,
"lifecycleState": "active",
"body": "We need a collaborative editing platform...",
"updatedAt": "2026-09-09T10:31:04Z"
}
{
"opId": "op_9012",
"docId": "doc_842",
"clientSeq": 391,
"baseVersion": 1842,
"appliedVersion": 1845,
"ownerEpoch": 27,
"authorUserId": "user_14",
"kind": "insert",
"status": "committed",
"payload": {
"position": 128,
"text": " collaborative"
}
}The platform should keep the materialized document body easy to read, while keeping the collaboration history append-oriented and replayable. The hot synchronization path needs small metadata records, not giant document rewrites for every keystroke.
WebSocket Architecture
Persistent sockets are what make collaboration feel live instead of like repeated polling.
Gateway responsibilities
The WebSocket Gateway authenticates connections, binds them to user and document sessions, forwards edit operations to the correct owner through the Shard Router, emits acks and remote updates back to clients, enforces heartbeats, and sheds abusive or stale connections. It should not own document truth itself; that belongs with the Document Server.
Session binding at connect time
When a client connects and subscribes to a document, the gateway: (1) authenticates identity, (2) authorizes access to that specific document, (3) binds a session/client identity, (4) resolves the document's current owner, and (5) establishes the client's last-known version so it can resume rather than start cold. Full lifecycle detail — heartbeats, reconnect, connection migration — lives in WebSocket Session Lifecycle (Architecture Deep Dive).
Backpressure and message validation
The gateway keeps bounded outbound buffers, coalesces or drops ephemeral presence updates before it ever touches committed document edits, and can resync or disconnect a persistently slow consumer — but it must never silently drop a committed edit to relieve queue pressure. Every inbound message is validated at this trust boundary: maximum message size, a valid operation type/schema, per-user/session rate limits, and current authorization.
Why not polling
Polling turns every edit into repeated HTTP requests, increases latency, and makes cursor or presence sync wasteful. Persistent sockets preserve a cheap channel for tiny frequent messages like keystrokes, selections, and heartbeats.
Document Storage and the Durability Boundary
The collaboration path needs both fast durable document state and a separate history representation — and it needs an explicit, honest answer to "when is an edit actually safe?"
Document Store vs Version Store
The Document Store keeps the latest materialized content that bootstrap reads need quickly. The Version Store keeps snapshots and revision history so audits, restores, and long-range replay do not overload the hot document row. The two stores are related but should not be confused: one serves now, the other preserves how now was reached.
The conceptual write flow
1. An operation reaches the current document owner. 2. The owner validates authorization, schema, and base state. 3. It deduplicates by opId. 4. It transforms or merges the operation against anything accepted since the client's base version. 5. It assigns the next authoritative version. 6. It appends the accepted operation to the durable log / replicated write path. 7. It updates materialized in-memory state. 8. It sends the committed acknowledgement. 9. It broadcasts the accepted operation to subscribers. 10. It updates or materializes a snapshot asynchronously as appropriate. The exact ordering of materialization versus broadcast can vary by implementation, but step 6 — durable persistence — is what step 8's "committed" ack is allowed to depend on.
The Document Store and Version Store are not one atomic transaction
It would be misleading to imply the Document Store and Version Store are always updated together as a single distributed transaction — in most real designs they are not. Recovery instead relies on the authoritative operation log being the source of truth, idempotent materialization (replaying the same operation twice produces the same result), explicit version markers on both stores, and reconciliation logic that can detect and repair a Document Store that lags behind the log (see Operation Log / Snapshot Divergence in Failure & Scale Scenarios).
Materialized state is a projection, not the only source of truth
The latest document body is best understood as a projection of accepted history — useful for fast reads, but not necessarily the only artifact recovery depends on. This does not mean the design mandates full event sourcing as the only valid approach; treat it as a design choice this architecture adopts because it makes recovery and auditability tractable, not as a universal requirement for every collaborative editor.
Read path
Cold clients generally read the latest snapshot from the Document Store, not the full operation lifetime. History browsing or restore flows consult the Version Store. This separation keeps normal document open latency predictable.
Presence Service
Presence is important, but it should be decoupled from the edit-consistency path so cursor chatter does not threaten document correctness.
What presence tracks
The Presence Service tracks active users, cursor positions, selections, join/leave events, and heartbeat freshness. This data is highly ephemeral: it is useful now, but most of it should not be stored like durable document history.
Why presence is separate
Presence events can be noisy and frequent. If every cursor move had to traverse the exact same correctness-critical path as text mutations, the system would waste authoritative capacity on ephemeral signals. Decoupling presence lets the editor remain social without making edit convergence fragile.
Presence is best effort, keyed by session
Presence updates can be coalesced or rate-limited without harming correctness, and presence should key on session/client identity rather than only user ID — one user can have the same document open in multiple tabs or devices, and collapsing that to a single presence entry would make one tab's disconnect incorrectly clear presence for the others. A reconnect rebuilds presence from scratch rather than trying to patch a half-stale set, and revoking a user's access must also remove their presence and subscription access, not just block further edits.
Synchronization Engine
The Synchronization Engine is the architectural heart of the platform because it decides how concurrent operations become one converged document timeline.
Architectural role
The engine receives operations from an Operation Queue, checks the client's baseVersion, and reconciles the operation against any edits already accepted since that version. In an Operational Transform (OT) design, the server transforms the incoming operation so it still means the user's original intent in the newer document context. In a CRDT design, replicas merge operations through a commutative data structure instead of pairwise transformation.
OT vs CRDT at this level
Operational Transform fits architectures with a strong authoritative server and ordered per-document processing — but it needs enough transformation history to reconcile an operation against everything accepted since its base revision. If that history has been compacted away, the server should require a snapshot-based rebase rather than pretending any arbitrarily stale operation can always be transformed cheaply (see OT History Retention in Architecture Deep Dive). CRDT fits architectures that want more peer-friendly or offline-tolerant merge semantics, but it is not simply "messages can arrive in any order and everything works" — the specific CRDT's merge rules matter, causal/context metadata may matter, duplicate handling still matters, and garbage-collecting accumulated metadata is a non-trivial problem of its own (see CRDT Metadata & Garbage Collection). Both solve convergence, but they shift complexity to different places in the system, and neither is universally superior.
Beyond a flat string: the document model
A real editor's operations rarely address a flat character stream alone. Content is typically structured into blocks or paragraphs, inline text spans, formatting marks, embedded objects, lists, and tables — and the synchronization strategy has to reason about whichever of these structures the document model actually uses. This module introduces the idea rather than building a full rich-text implementation (see Structured Document Model in Architecture Deep Dive for the fuller treatment).
Conflict Resolution
Conflict resolution is where the system graduates from 'last write wins' failure to a real collaborative architecture.
The naive failure mode
If the platform stores only whole-document saves or applies operations blindly against stale positions, one user's work can erase another's or produce broken text. That is acceptable for single-writer drafts, but disastrous for shared editing.
The transform-based fix
A proper Conflict Resolution flow applies deterministic transformation or merge rules designed to preserve edits and converge. When an operation arrives against version 42 but the document is already at version 45, the Synchronization Engine transforms or merges the incoming edit against versions 43–45, then broadcasts the resolved result. 'Resolved' does not mean every user gets their exact character positions unchanged, and it is not a promise that concurrent semantic intent is always preserved perfectly — occasionally a transformed result can read a little oddly even though the system behaved correctly.
Three properties that are easy to conflate
Convergence — replicas eventually reach the same state. Intention preservation — the algorithm attempts to keep edits meaningful, on a best-effort basis. Durability — accepted edits survive failure. A design can satisfy convergence and durability perfectly while still occasionally producing an intention-preservation result that feels slightly off — these are three separate properties, not one bundled guarantee.
Version History
Version history is not just a user feature. It is an operational safety net that reduces recovery and restore complexity.
Snapshot cadence and consistency
The platform can checkpoint documents every N operations, every M seconds, or at semantic events such as 'user idle' or 'major revision saved.' Frequent snapshots improve restore speed but cost more storage; sparse snapshots make recovery slower. Every snapshot must correspond to a known authoritative version — the system should never snapshot arbitrary in-memory state without knowing exactly which operations it includes, or restore and reconnect both become unreliable (see Snapshot & Operation Log in Architecture Deep Dive).
Compaction
After a durable snapshot at a given version, older operations may become eligible for compaction — but eligibility depends on restore/history requirements, OT transform-history needs, the offline-client retention window, and audit policy. The system should not delete old operations simply because a snapshot exists if active or reconnecting clients still need them (see Snapshot Compaction & Retention in Architecture Deep Dive).
Restore flow
A restore request first verifies the requesting user still has permission to restore. It then reads the chosen snapshot from the Version Store, rehydrates the document, records the restore as a new authoritative version flowing through the normal collaboration path, and notifies/rebases connected clients onto the new state. Treat restore as a fresh mutation, not as magical time travel that bypasses the collaboration pipeline.
Why history helps operations
Revision history is also useful for audits, incident recovery, and corruption repair. It gives operators a stable point to roll back to when a bad client or buggy transform damages a document.
Offline Sync
Offline editing is where the platform proves it can separate local responsiveness from eventual convergence.
Disconnect and local queue
When the socket drops, the Editor Client should keep applying local edits to its buffer and append them into an Offline Queue with stable operation IDs and the last known base version. The user's typing should not freeze simply because the network is gone. Returning from offline is reconciliation, not a simple retry — the client has to reconcile its last acknowledged version, any missing remote operations or a current snapshot, its locally queued operations, its current authorization, and the document's current ownership, all at once.
The reconnect handshake
1. Client authenticates. 2. Server rechecks the client's current document permission — access may have changed while it was offline. 3. Client reports its last acknowledged version. 4. Client reports its queued operation IDs/sequence. 5. If history is retained and the gap is small, the server returns the missing operations. 6. Otherwise the server returns a current snapshot and a rebase instruction. 7. Queued local edits are transformed or merged against current state. 8. Duplicate operations are ignored idempotently. 9. Accepted replayed operations receive authoritative versions. 10. Normal live mode resumes. Full mechanics live in Offline Reconnect Protocol (Architecture Deep Dive).
Permission change while offline
A user may lose edit permission entirely while disconnected. Step 2 above exists specifically to catch this: the system must not blindly replay queued writes after reconnect just because a client has them queued locally. The UI may preserve or let the user export their unsynced local work, but the server enforces current authorization regardless of what the client believes it is entitled to replay.
Final architecture
The production architecture is best understood as four planes working together. The connection path (Client → Gateway) authenticates and binds sessions but holds no document truth. The authoritative edit path (Gateway → Shard Router → current Document Owner → Synchronization Engine → durable operation history) is the only place operations are validated, deduplicated, ordered, and committed — protected by an ownership lease and fencing epoch so exactly one owner can write at a time. The distribution path (accepted operation → Pub/Sub/fan-out → subscribed gateways/clients) spreads already-accepted operations to peers, but is a delivery mechanism, not a source of truth — clients detect version gaps and resync from the authoritative path rather than trusting broadcast alone. Supporting paths — presence, snapshots/history, offline resync, authorization, and observability — run alongside the edit path without being allowed to block or weaken it.
A strong interview story often compresses the architecture evolution into a clear ladder: 1. Single User Editor → 2. Multi-User Editing → 3. WebSocket Based Collaboration → 4. Cursor Synchronization → 5. Conflict Resolution → 6. Operational Transform → 7. Presence Service → 8. Version History → 9. Offline Editing → 10. Large Scale Collaboration → 11. Production Scale Architecture. The point is to show that each subsystem exists because the previous stage stopped being good enough.
- 01A collaborative editor is a real-time synchronization system wrapped around a document model, not just a text box with autosave.
- 02The authoritative path is usually Editor Client → WebSocket Gateway → Shard Router → Document Server → Synchronization Engine → Pub/Sub Broadcast Layer → peers, protected end to end by ownership fencing and explicit durability semantics.
- 03Presence, history, and offline replay should support the edit path without destabilizing it.
- 04OT and CRDT are both convergence tools; the surrounding architecture still needs durable storage, reconnection logic, shard ownership, and fan-out control.
- 05Production scale depends on connection management, hot-document isolation, and clean ownership of each document shard.