{"post":{"slug":"crdt-explained-2026","title":"CRDTs Explained: Merging Edits Without a Server Deciding","excerpt":"Conflict-free replicated data types let concurrent edits merge automatically into the same result. Here is how they work and what they cost.","category":"code","date":"July 24, 2026","author":"ByteLedger Team","content":"<span class=\"dropcap\">T</span>wo people edit the same document while offline. Both come back online. Something has to decide what the document now says, and the traditional answer is a server that receives both versions and resolves the conflict — by picking one, by asking a human, or by a merge algorithm.\n\nCRDTs remove the need for that arbiter. The data structures are designed so that applying concurrent changes in any order produces the same final state, mathematically guaranteed.\n\n## What changed in 2026\n\n- **Library maturity improved substantially.** Production-ready implementations for text, lists, and maps reduced the amount teams needed to build themselves.\n- **Metadata overhead shrank.** Compression and garbage collection techniques cut the historical metadata that made early CRDTs impractical for large documents.\n- **Local-first architecture gained traction.** Applications treating the local replica as authoritative and sync as a background concern became a recognized category.\n- **The intent-preservation gap stayed.** Recognition that convergence does not mean the merged result is what users wanted remained the honest limitation.\n\n## What the guarantee actually is\n\n| Property | Guaranteed |\n| --- | --- |\n| All replicas converge to the same state | Yes |\n| No coordination required to merge | Yes |\n| Merges are order-independent | Yes |\n| Works offline indefinitely | Yes |\n| The merged result preserves user intent | No |\n| Application invariants are maintained | No |\n\nThe last two rows are where expectations break. If two people concurrently edit a sentence, a text CRDT will produce a deterministic merge that both replicas agree on — and that merge may be a garbled interleaving of both edits that neither person wanted. Convergence is a consistency property, not a semantic one.\n\nSimilarly, if your application requires that a total never exceeds a limit, concurrent increments on separate replicas can converge to a value that violates it. CRDTs guarantee agreement about the number, not that the number is allowed.\n\n## When they are worth it\n\nThe clear case is collaborative editing where users need to work offline and merge later without a server deciding. Document editors, note-taking applications, and design tools with offline support are where CRDTs earn their complexity.\n\nThe other case is peer-to-peer or partition-tolerant systems where no central arbiter exists or can be reached. If replicas must merge without coordination, this is the mechanism.\n\nThe case against is that most applications have a server, and a server can arbitrate. Last-write-wins with a timestamp, or operational transformation with a central sequencer, or simply locking, are all simpler and adequate when a central authority exists. Adopting CRDTs because they sound principled, in a system with a perfectly good server, buys metadata overhead and conceptual complexity for a problem you did not have.\n\nStorage overhead remains real even with modern compaction. The structures carry information about the history of operations to make order-independent merging possible, and for a long-lived frequently-edited document that accumulates.\n\n## Common mistakes\n\n- **Expecting intent preservation.** Convergence is agreement, not correctness.\n- **Using them where a server can arbitrate.** Simpler options exist.\n- **Ignoring metadata growth.** Long-lived documents accumulate; plan compaction.\n- **Assuming invariants hold across replicas.** They do not.\n- **Building your own.** The correctness proofs are subtle; use a mature library.\n- **Applying them to the whole application state.** Use them for the collaborative parts only.\n\n## FAQ\n\n**How do they compare to operational transformation?**\nOperational transformation transforms operations against each other and typically needs a central sequencer. CRDTs need no coordination and carry more metadata. Both are used in production editors.\n\n**Can they handle rich text?**\nYes, with more complexity than plain text — formatting spans interact with concurrent insertions in ways that need careful design.\n\n**Do they work with a database?**\nThe CRDT is the merge logic; storage is separate. Many implementations persist state and sync deltas.\n\n**What about deletions?**\nDeletions typically leave tombstones so concurrent operations referencing the deleted element still merge correctly. Garbage collecting tombstones safely is one of the harder parts.\n\n## Where to go next\n\nFor ordering in distributed systems, read [vector clocks explained](/blog/vector-clocks-explained-2026). For coordinated multi-step operations, [saga pattern explained](/blog/saga-pattern-explained-2026).","hue":300,"metaTitle":"CRDTs Explained: Conflict-Free Merging in 2026","metaDescription":"How conflict-free replicated data types merge concurrent edits deterministically, why convergence is not intent preservation, and their metadata cost.","keywords":["crdt explained","conflict free replicated data types","collaborative editing sync","offline first architecture","eventual consistency merge","operational transformation comparison","local first software","distributed state sync","distributed systems 2026"],"tldr":["**CRDTs guarantee that concurrent edits converge** — every replica reaches the same state regardless of merge order.","**Convergence is not correctness** — the merged result is consistent and may not be what either user intended.","**Metadata overhead is the main cost** — the structures carry history to make merging work.","**They enable offline-first and peer-to-peer editing** — no central authority needed to resolve conflicts.","**Skip:** CRDTs when a server can arbitrate. Central conflict resolution is simpler and often sufficient."],"readTime":"3 min read","wordCount":689},"related":[{"slug":"microservices-vs-monolith-2026","title":"Microservices vs monolith in 2026: a clear decision rule","excerpt":"Microservices solve organizational scaling, not technical scaling. This guide gives an honest comparison and a decision rule most teams can follow.","category":"code","date":"May 12, 2026","author":"ByteLedger Team","readTime":"4 min read","hue":240},{"slug":"reverse-etl-explained-2026","title":"Reverse ETL Explained: Sending Data Back in 2026","excerpt":"Reverse ETL pushes clean, modeled data from your warehouse back into Salesforce, HubSpot, and other business tools. Here is how it works and when you actually need it.","category":"code","date":"August 8, 2026","author":"ByteLedger Team","readTime":"4 min read","hue":312},{"slug":"eventual-consistency-explained-2026","title":"Eventual consistency explained in 2026: when data catches up","excerpt":"Eventual consistency means every copy of your data will agree eventually, just not instantly. This 2026 guide explains the tradeoff, where brief staleness is fine, and where you should demand strong reads.","category":"code","date":"June 29, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":310}],"sameCategory":[{"slug":"bazel-build-explained-2026","title":"Bazel Explained: What Hermetic Builds Actually Cost","excerpt":"Bazel delivers reproducible, precisely cached builds and demands that you describe everything. Here is what you get, what it costs, and who should say no.","category":"code","date":"August 19, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":145},{"slug":"graphql-federation-2026","title":"GraphQL Federation: One Graph, Many Teams","excerpt":"Federation composes independently-owned subgraphs into a single API. Here is what it solves, the operational cost it adds, and when a simpler gateway is enough.","category":"code","date":"August 19, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":300},{"slug":"hermetic-builds-explained-2026","title":"Hermetic Builds Explained: Same Inputs, Same Output","excerpt":"A hermetic build depends only on declared inputs. Here is what that property gives you, the common leaks that break it, and how to move toward it incrementally.","category":"code","date":"August 19, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":130},{"slug":"monorepo-tooling-compared-2026","title":"Monorepo Tooling Compared: What You Actually Need","excerpt":"Monorepo tools solve task orchestration and caching, not repository layout. Here is what each tier provides and how to tell when you have outgrown the simple option.","category":"code","date":"August 19, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":150}],"newer":{"slug":"canary-release-ai-2026","title":"Canary Releases for AI Features: Rolling Out Safely","excerpt":"A model or prompt change can degrade quality without throwing a single error. Here is how to roll one out gradually and what signals tell you to stop.","category":"ai","date":"July 24, 2026","author":"ByteLedger Team","readTime":"4 min read","hue":202},"older":{"slug":"cursor-pagination-explained-2026","title":"Cursor Pagination: Why Offset Breaks at Scale","excerpt":"Offset pagination gets slower with every page and skips rows when data changes. Cursor pagination fixes both. Here is how to implement it correctly.","category":"code","date":"July 24, 2026","author":"ByteLedger Team","readTime":"4 min read","hue":218}}