DEV Community

Cover image for How Notion Lets Everyone Edit the Same Document at Once Without Conflicts
Abdullah al Mubin
Abdullah al Mubin

Posted on

How Notion Lets Everyone Edit the Same Document at Once Without Conflicts

You type something in Notion.

Your friend deletes a paragraph.

Someone else is editing the same sentence from another country.

And then… your internet dies.

You close the laptop.

Come back later.

Everything is still perfectly synced.

No conflicts.
No “merge errors.”
No lost edits.

And the most surprising part?

Nobody needed a central authority to “fix” it.

So how does this actually work?

The answer is a system called CRDTs.


Index


First, Let’s Talk About the Old World Problem

Before CRDTs, real-time collaboration was messy.

Two people editing the same thing usually meant:

  • overwriting each other’s changes
  • locking documents
  • or relying on a central server to decide “the truth”

And if the network failed?

Everything broke.

Because systems assumed:

There must be one correct version of the document at all times.

But CRDTs flip that idea completely.


The CRDT Mindset Shift

CRDT stands for:

Conflict-free Replicated Data Types

But don’t let the name scare you.

Here’s the real idea:

Instead of preventing conflicts, CRDTs make conflicts impossible.

That’s it.

  • No fighting edits.
  • No merging disasters.
  • No central referee.

Every device is allowed to work independently.

Even offline.


A Story: Two People, One Document, No Internet

Imagine this:

You and your friend are editing the same document.

But there’s a twist:

  • No internet connection between you

You both type freely.

You:

“Hello Beautiful World”

Your friend:

deletes “World” and adds “Everyone”

Now both of you go offline for a while.

Later, your devices reconnect.

Normally, this would be chaos.

But CRDTs say:

“Relax. I already designed your data so it can merge itself.”


The Secret: Data That Knows How to Merge Itself

Instead of storing just text like:

txt
Hello World
Enter fullscreen mode Exit fullscreen mode

CRDTs store data in a smarter way:

  • every character has a unique ID
  • every operation is tracked
  • every change is designed to merge safely

So instead of “overwriting”, devices just exchange structured changes.


No Central Server Needed

This is where CRDTs feel almost rebellious.

Unlike traditional systems:

  • No single source of truth
  • No strict ordering requirement
  • No central conflict resolution

Each device is:

a fully independent editor that eventually agrees with everyone else

Even if they were offline for hours.


So How Do Conflicts Disappear?

Instead of asking:

“Which version is correct?”

CRDTs ask:

“Can we design data so all versions naturally converge?”

So when two edits happen:

  • they don’t overwrite each other
  • they merge mathematically
  • and always reach the same final result

No arguments required.


A Simple Mental Model

Think of CRDTs like LEGO blocks.

Each edit is a block.

No matter how you:

  • add them
  • remove them
  • reorder them

You always end up with a structure that still makes sense.

That’s why CRDTs are so powerful.


Why CRDTs Feel Like Magic in Notion

Apps like Notion feel:

  • instant
  • reliable
  • offline-friendly
  • conflict-free

Because CRDTs allow:

Offline editing

You don’t need internet to keep working.

Automatic syncing

Everything merges when you reconnect.

No conflict dialogs

No “resolve this merge” popups.

Multi-user editing

Everyone writes at the same time safely.


CRDTs vs Traditional Systems

Old way (centralized)

  • server decides truth
  • clients must wait
  • conflicts resolved centrally

CRDT way (distributed)

  • everyone has a copy
  • everyone can edit anytime
  • system merges automatically

Why CRDTs Are Hard (But Brilliant)

CRDTs are not “simple under the hood”.

They require:

  • careful data structure design
  • mathematically proven merging rules
  • handling edge cases like ordering, deletion, and concurrency

But once built correctly:

they are extremely robust in unreliable networks


Where CRDTs Are Used Today

You’ll find CRDTs in:

  • Notion (collaboration system parts)
  • Figma (some real-time sync layers)
  • Multiplayer apps
  • Offline-first tools
  • Distributed databases
  • Collaborative editors

Anywhere users expect:

“It just works, even if the network doesn’t”


CRDTs vs Operational Transformation

If OT is like:

a smart referee fixing edits in real-time

Then CRDTs are like:

giving every player the same rulebook so nobody ever disagrees in the first place


Final Thought

CRDTs represent a powerful idea in modern system design:

You don’t fix distributed problems by controlling systems tightly…
you fix them by designing systems that can heal themselves.

That’s why tools like Notion feel so smooth.

Because underneath the UI, there’s no panic.

No conflict.

Just data quietly agreeing with itself across the world.


Top comments (0)