惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
博客园 - 司徒正美
博客园_首页
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
I
InfoQ
M
MIT News - Artificial intelligence
T
Tailwind CSS Blog
L
LangChain Blog
Last Week in AI
Last Week in AI
A
About on SuperTechFans
B
Blog
博客园 - 叶小钗
雷峰网
雷峰网
H
Help Net Security
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
CRDT vs Operational Transformation: How Google Docs and N...
Abdullah al Mubin · 2026-05-30 · via DEV Community

You’re typing in a document.

Someone else deletes the sentence you’re writing.

Another person edits the same line from another country.

And somehow…

nothing breaks.

No overwrites.
No duplicated text.
No “conflict error” popups.

It feels like magic.

But behind this smooth experience are two competing ideas:

Operational Transformation (OT)
Conflict-free Replicated Data Types (CRDTs)

Both solve the same problem:

How do multiple people edit the same thing at the same time without breaking it?

But they do it in completely different ways.

Let’s break it down like a story.

Index


1. The Problem They Both Solve

Imagine this text:

txt id="base_doc"
Hello World

Enter fullscreen mode Exit fullscreen mode

Two people edit it at the same time:

  • Person A inserts “Beautiful ”
  • Person B deletes “World”

Now the system has a question:

What is the final correct version?

This is where chaos usually begins.

Unless you have OT or CRDT.


2. The Two Philosophies

Operational Transformation (OT)

OT says:

“We will fix conflicts in real-time by transforming operations.”

Think of it like:

A smart referee adjusting players’ moves so the game stays fair.


CRDT (Conflict-free Replicated Data Types)

CRDT says:

“Let’s design the system so conflicts can NEVER happen.”

Think of it like:

Everyone follows a rulebook so good that disagreement is impossible.


3. A Real-Life Analogy

OT = Traffic Cop

Cars (edits) arrive at an intersection.

The cop (server) decides:

  • who goes first
  • how to adjust timing
  • how to avoid crashes

  • Central coordination required


CRDT = Self-Driving Cars

Every car knows the rules.

They coordinate locally.

No cop needed.

  • No central authority

4. How OT Works (Simple Version)

OT systems:

  1. User sends an operation
  2. Server receives multiple operations
  3. Server transforms operations based on order
  4. Everyone gets adjusted updates

Example:

txt id="ot_flow"

Enter fullscreen mode Exit fullscreen mode

Insert("Beautiful ", pos=6)
Delete("World", pos=6)

If order changes, OT adjusts positions so both still make sense.

  • The key idea: transform before applying

5. How CRDT Works (Simple Version)

CRDT systems don’t “fix conflicts”.

Instead they:

  • assign unique IDs to everything
  • allow independent edits
  • merge changes mathematically

So instead of:

“Where should this insert go?”

CRDT says:

“This character has a permanent identity. Merge is automatic.”

Even if users were offline.

  • The key idea: design data that always merges safely

6. The BIG Difference

Feature OT CRDT
Coordination Central server No central server needed
Conflict handling Transformed in real-time Designed to avoid conflicts
Offline support Weak Excellent
Complexity High in server logic High in data structure
Scaling Harder at large scale Easier in distributed systems

7. Mental Model That Actually Helps

OT = Editing is a live conversation

Everyone talks at once
A referee keeps adjusting meaning so it stays understandable


CRDT = Everyone writes in ink that auto-merges

Each person writes independently
Ink is designed to blend perfectly later


8. Where You’ve Seen Them Without Knowing

OT is used in:

  • Classic Google Docs architecture
  • Etherpad
  • Some collaborative editors

CRDT is used in:

  • Notion (modern systems)
  • Figma (parts of it)
  • Offline-first apps
  • Distributed databases
  • Multiplayer collaborative tools

9. Why OT Feels Hard

OT struggles with:

  • ordering edits correctly
  • concurrent transformations
  • edge cases explosion
  • server coordination bottlenecks

But it works extremely well in controlled systems.


10. Why CRDT Feels Magical

CRDT shines because:

  • works offline
  • merges automatically
  • no central conflict resolution
  • scales beautifully across systems

But…

It requires very carefully designed data structures.


11. The Key Insight

Both OT and CRDT are trying to solve the same deep problem:

“How do humans collaborate in real time without stepping on each other’s work?”

But they approach it differently:

OT:

Fix conflicts as they happen

CRDT:

Design so conflicts never happen


12. Final Thought

The next time you see multiple cursors typing in a document…

remember:

You’re not just seeing text editing.

You’re seeing one of two invisible systems at work:

Either a referee constantly rewriting reality (OT)
Or a system designed so reality never disagrees (CRDT)

And that’s what makes modern collaboration tools feel effortless.