Published OnSeptember 30, 2025September 30, 2025
Offline, Online, Always Consistent
How CRDTs Power Conflict-Free Sync at the Edge
We live in a world where connectivity can’t always be guaranteed. A slow internet connection can be just as damaging as no connection at all, especially in industries like retail, healthcare, logistics, and manufacturing where real-time data sharing is mission-critical.
In these environments, waiting for cloud servers to reconcile updates is inconvenient, can lead to lost sales, broken workflows, and even safety risks. The question is: how can applications “just work” offline, without introducing the nightmare of merge conflicts?
Enter CRDTs: Conflict-Free Replicated Data Types
CRDTs (Conflict-free Replicated Data Types) are the mathematical foundation that allows data to sync across devices without conflicts. Instead of leaving developers to wrestle with version mismatches or chaos with data overwrites, CRDTs guarantee consistency even when devices update data offline and later reconnect.
Think of CRDTs as the bridge between “always available” apps and the reality of unreliable networks. They ensure that when devices finally come back online, all updates merge consistently and predictably, with no lost changes.
Why CRDTs Matter for an Offline-First World
At Ditto, we believe applications should work no matter the network conditions. Whether it’s a retail checkout terminal, a warehouse scanner, or a device in the field, users expect seamless performance. CRDTs make this possible by ensuring:
- Automatic conflict resolution — no human intervention required.
- Continuous productivity — even with spotty or no connectivity.
- Scalability at the edge — across enterprise, industrial, telco, and tactical environments
How Ditto Uses CRDTs
Ditto’s distributed database platform uses CRDTs to power real-time peer-to-peer sync. Small peers like mobile devices, IoT sensors, or edge computers automatically discover each other, form mesh networks, and sync data without needing a server to mediate changes or be the sole source of truth.
Instead, each device runs a local Ditto database locally, and uses CRDTs to sync and reconcile changes with other small peers, ensuring data consistency across the entire mesh network.
We use multiple connection technologies, including Bluetooth Low Energy, Peer-to-Peer Wi-Fi and Local Area Networks. This allows data to sync up to 130 meters (425 feet), and even further with multihop. Developers get platform-agnostic APIs for web, mobile, IoT, and server-side applications — making it easy to build reliable, offline-first experiences.
Going Deeper: How CRDTs Actually Work
CRDTs are built around mathematical properties that guarantee eventual consistency without coordination. In traditional distributed systems, nodes must often rely on consensus protocols (like Paxos or Raft) to ensure agreement on state. While powerful, those approaches can be slow or brittle in edge scenarios with unstable connectivity.
CRDTs sidestep the issue by ensuring that operations themselves are designed to always converge. They do this in two primary flavors:
1. State-based CRDTs (Convergent Replicated Data Types, CvRDTs)
Each replica periodically ships its full state to other replicas. When two replicas exchange states, they merge them using a mathematically defined join operation that is:
- Commutative (order of operations doesn’t matter),
- Associative (grouping doesn’t matter), and
- Idempotent (applying the same operation multiple times has no additional effect).
This ensures that after enough exchanges, all replicas converge to the same value.
2. Operation-based CRDTs (Commutative Replicated Data Types, CmRDTs)
Instead of shipping the whole state, replicas send operations (e.g., “increment counter by 2” rather than the total count). Each operation is guaranteed to commute — meaning no matter the order of delivery, the end state will be correct.
Operation-based CRDTs are often more efficient since they send smaller payloads, but they require reliable causal broadcast to ensure delivery of all operations.
Why This Matters for the Edge
In edge environments like retail stores, quick-service restaurants, industrial sites, or tactical operations, devices often go offline, reconnect at unpredictable times, and exchange updates over flaky networks. Traditional systems risk creating merge conflicts or data loss in these scenarios.
CRDTs eliminate that risk by ensuring:
- No central coordination is needed. Devices can confidently update data offline.
- All replicas converge. Whether updates flow through Bluetooth, local Wi-Fi, or the cloud, the final state is the same everywhere.
- Conflicts don’t exist by design. What looks like a “conflict” in a naive system is simply another valid input in a CRDT system, merged deterministically.
A Quick Example
Imagine two warehouse scanners tracking the number of boxes on a pallet.
- Device A, offline, increments the counter from 10 to 11.
- Device B, also offline, increments from 10 to 12.
When they reconnect, CRDT logic ensures both devices converge on the correct total: 13. There’s no overwrite, where one device “wins,” just mathematically correct convergence.
What makes CRDTs especially powerful at the edge is that they don’t require a central coordinator. Each device can confidently apply updates locally and trust that, once connected, its state will converge with others, without manual conflict resolution.
Real-World Impact
When businesses don’t have to worry about dropped connections or manual conflict resolution, they can focus on delivering exceptional user experiences. From enterprise edge to tactical edge, CRDTs and Ditto’s sync technology are transforming how data flows — reliably, securely, and without interruption.
The edge is messy. Networks drop. Devices move in and out of range. But with CRDTs, consistency doesn’t have to suffer. At Ditto, we’re making sure applications are always consistent — offline, online, and everywhere in between.

