The night before the project is due
Priya and Rahul have one shared document and a school project due at 9 am. Priya types on her laptop at home. Rahul types on his phone on the bus. (They, and everything that happens to them tonight, are made up for teaching.)
At 9 pm the document holds one word: cat. Priya wants it to say chat, so she inserts h at position 1. At the same moment Rahul deletes the t at position 2. Each edit is correct for the text that person can see.
Then Priya's screen shows cht and Rahul's shows cha. They are looking at the same document and it says two different things. Rahul's "position 2" meant t on his screen, but after Priya's insertion, position 2 on her screen is a.
Every idea in this guide fixes a problem Priya and Rahul hit tonight:
| Time |
What goes wrong |
Idea that fixes it |
| 9 pm |
Their screens disagree |
Operational transformation (OT) |
| 10 pm |
Rahul's bus enters a tunnel and he keeps typing offline |
CRDTs |
| 11 pm |
The document server restarts mid-sentence |
Architecture: session owner, log, snapshots |
| 11:30 pm |
The whole class opens the doc to watch |
Presence, fan-out, scaling |
| Midnight |
"Did we need any of this for the marks sheet?" |
Simpler alternatives |
The goal throughout: concurrent edits made against different versions must combine so everyone ends on the same text, and each person's intent survives. This guide continues from Consistency models, where CRDTs first appeared.
Operational transformation (OT), from Ellis and Gibbs, keeps each edit as an operation, such as "insert h at index 1" or "delete index 2". When an operation arrives that was made at the same time as others, OT transforms it against them so it still means what its author meant.
You've reached the free preview of this post.
Subscribe to the Blogs plan (₹99/mo) — or use any Algomi Suite, Career, Investor, or Trader plan — to keep reading.
See plans