DEV Community

Aditya Madhavi
Aditya Madhavi

Posted on

✍️ How Multiple Devices Edit One Google Doc

Ever wondered how multiple people can edit the same Google Doc at the same time without breaking the document? 🤔
Behind the scenes, it’s powered by something called Operational Transformation (OT).

🔍 What Happens in Real-Time?
Every keystroke you make is converted into an operation (like “insert text” or “delete text”).
When multiple users type at the same time:

These operations reach the server
The system orders them
Then it transforms (adjusts) conflicting operations

⚙️ How Conflicts Are Resolved
If two users type at the same position, OT ensures:

One operation is applied first
The next operation is shifted or modified accordingly

✅ No data is lost
✅ Everyone sees the same final document

🧠 Key Insight

OT doesn’t block conflicts — it smartly adjusts them so all edits can coexist.

Top comments (0)