CRDTs
Computer Scienceconcept · 6 मिनट · अपडेट 19 जुल॰ 2026

CRDTs

लेखक Rajendra Sharma, RN, CPC, CPBसमीक्षक Rajendra Sharma, RN, CPC, CPB · 29 जून 2026

Data structures that merge concurrent edits automatically — how offline-first health apps sync without a referee.

In one line

A CRDT (Conflict-free Replicated Data Type) is a data structure designed so replicas edited independently — offline, concurrently — always merge to the same state, by mathematics rather than by a central server deciding winners.

replica Aedit X replica Bedit Y merge → X + Yconverged
CRDTs let replicas accept edits offline and merge automatically to one consistent state — no central coordination, no conflicts.

The problem it solves

When two people edit the same data while disconnected — a nurse and a doctor updating a care plan during a connectivity gap — what happens when they reconnect? The crude answer is "last write wins," which silently throws away one person's work. CRDTs replace that with a structure where both edits survive and merge predictably, no central referee required.

How it works

The core trick: operations are designed to be commutative — apply them in any order, on any replica, and you arrive at the same final state. That mathematical property is what guarantees convergence without coordination.

  • Many data types have CRDT formulations — counters, sets, maps, and rich-text sequences.
  • Libraries package them for application use — Automerge and Yjs are the well-known ones.
  • The cost is metadata — tombstones (to remember deletions) and per-item clocks add overhead.

The clinical caveat

A crucial distinction: merging without conflict is not the same as merging with clinical sense. The math can auto-merge two medication edits into a coherent data structure that is still clinically wrong. So a deliberate human review step can be the right design even when the CRDT could merge silently — automatic convergence is a sync guarantee, not a safety guarantee.

Where it shows up in digital health

  • Community-health-worker apps that work offline for days — the offline-first pattern in LMIC and rural deployments (directly relevant to India-scale reach).
  • Collaborative care-plan editing.
  • Sync layers of PWAs — including the offline reading this platform plans.

CRDTs are why "last write wins" is no longer the only answer to two clinicians editing the same note in a connectivity gap.

Common pitfalls

  • Assuming auto-merge = correct — converged data can still be clinically nonsensical; add review where safety demands.
  • Metadata growth — tombstones and clocks accumulate; understand the storage cost.
  • Reaching for CRDTs when you don't need them — if you have reliable connectivity and a server can arbitrate, simpler models may suffice.

Key takeaways

  • A CRDT merges concurrent, offline edits to one consistent state — by commutative math, no referee.
  • Automerge/Yjs implement them; the cost is metadata overhead.
  • Convergence is a sync guarantee, not a clinical-correctness guarantee — review where it matters.
  • The backbone of offline-first health apps — vital for low-connectivity, India-scale reach.

अपना स्मरण जाँचें

2 में से 0 याद

दोबारा पढ़ने से बेहतर है सक्रिय स्मरण — पहले उत्तर सोचें, फिर देखें।

  1. What problem do CRDTs solve?

  2. The clinical caveat for CRDTs?

संदर्भ

  1. Shapiro et al. — Conflict-free Replicated Data Types (2011)

संबंधित entries