Distilled • Google Docs
Design
-
Clients send document editing operations to the WebSocket Server.
-
The real-time communication is handled by the WebSocket Server.
-
Documents operations are persisted in the Message Queue.
-
The File Operation Server consumes operations produced by clients and generates transformed operations using collaboration algorithms.
-
Three types of data are stored: file metadata, file content, and operations.
-
One of the biggest challenges is real-time conflict resolution. Common algorithms include:
-
Operational transformation (OT)
-
Differential Synchronization (DS)
-
Conflict-free replicated data type (CRDT)
-
-
Google Doc uses OT according to its Wikipedia page and CRDT is an active area of research for real-time concurrent editing.