algomiBlogs
← All posts

Collaborative Editing: Operational Transformation, CRDTs, and Presence

Algomi Research · Created 2026-09-29 · Updated 2026-10-15 · System Design

Interview Roadmap Deep Dives · Part 12 of 28
Location-Based Services: Geohash, Quadtrees, Nearby Search, and Ride MatchingStock Exchange and Broker Design: Order Books, Matching Engines, and Risk
Page 1 of 1

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.

1. 9 pm: "Our screens disagree": operational transformation

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

Sources

Interview Roadmap Deep Dives · Part 12 of 28
Location-Based Services: Geohash, Quadtrees, Nearby Search, and Ride MatchingStock Exchange and Broker Design: Order Books, Matching Engines, and Risk