What is Ditto?
Ditto is the only mobile database with built-in edge device connectivity and resiliency, enabling apps to synchronize without relying on a central server or constant cloud connectivity. Through the use of CRDTs and P2P mesh replication, Ditto allows you to build collaborative, resilient applications where data is always available and up-to-date for every user. This allows you to keep mission-critical systems online when it matters most.
Overview
The Ditto Edge Sync Platform consists of two key components.
Small Peer (Ditto SDK)
An embedded database that runs on mobile or edge devices to power applications that use the Ditto SDK.
As well as providing a local database, the Small Peer also has built-in mesh connectivity to other Ditto-enabled devices (peers), enabling apps to synchronize data without relying on a central server or constant cloud connectivity.
Big Peer (Ditto Gateway)
A cluster of servers that can run on-premises or in the cloud, that augments the SDK’s local-first capabilities with cloud-based synchronization, identity management, monitoring and data integration features.
While synchronization does not rely on the Big Peer, the Big Peer removes all of the complexity of:
• Integrating a P2P system like Ditto with your wider data ecosystem (e.g. Analytics, MongoDB, Object Storage, etc.)
• Providing a synchronization fallback for physically dispersed devices
• Monitoring and managing your fleet of Small Peers
Ditto melds a local-first database with intelligent networking and synchronization. Its offline-first operation, real-time peer-to-peer sync, CRDT-driven conflict resolution, and JSON document storage all work together to provide a robust platform for building modern, distributed applications. By handling the hard problems of data sync and consistency for you, Ditto lets you focus on your app’s features - confident that your data will stay available, consistent, and in sync across every device and environment.
Built for Offline-First Operation
Ditto uses an offline-first architecture, which means your app remains fully functional even when offline. Each device maintains a local database, so it can always read and write data without a network connection. Any changes made offline are stored on the device and automatically synced out, and any changes made elsewhere are automatically merged into your local database, when the device comes back online. Your users can keep working uninterrupted; Ditto will seamlessly handle all connectivity, data replication, and conflict resolution. This ensures a smooth experience in unreliable network environments, as the application never has to “pause” or degrade functionality due to lack of internet access.
Under the hood, Ditto employs Conflict-Free Replicated Data Types (CRDTs) to handle data consistency and merging. This means that if multiple devices or users edit the same piece of data concurrently - even while offline - Ditto can merge those changes automatically once the devices sync up, without dropping or overwriting data. Every device maintains its own copy of the data and thanks to CRDTs, all copies will eventually converge to the same consistent state after synchronization, following a causal consistency model. Developers don’t need to write complex conflict resolution logic or worry about “last write wins” scenarios; Ditto’s CRDT-based engine resolves conflicts deterministically based on its data type rules. The end result is true multi-writer collaboration: all peers can edit data independently, and Ditto will transparently reconcile any conflicts, ensuring no changes are lost and all devices see a unified dataset.
Peer-to-Peer Mesh Networking
A key differentiator of Ditto is its peer-to-peer (P2P) mesh networking capability. Ditto-enabled devices can discover and communicate with each other directly, forming an ad-hoc mesh network rather than routing everything through a cloud server. The platform automatically handles the complexity of discovery and connectivity using whatever channels are available - for example, Bluetooth, peer-to-peer Wi-Fi, or local LAN - to find nearby devices and sync data with them.
This means your apps can share data in real time even in local or offline-only scenarios (for instance, on an airplane, in a remote field site, or during an internet outage). You do not need to write a single line of custom networking code, Ditto will automatically handle the complexity of discovery and connectivity using whatever channels are available - for example, Bluetooth, peer-to-peer Wi-Fi, or local LAN - to find nearby devices and sync data with them.
Real-Time Data Synchronization
Ditto is built for real-time sync, ensuring that updates propagate to other devices almost instantly. When data changes on one device, Ditto’s engine quickly distributes that change to all other connected peers. There’s no need for you to implement manual refresh logic or polling; Ditto uses a reactive subscription model that pushes updates as soon as they happen, so apps get data changes in real time. This low-latency synchronization is ideal for collaborative applications. Because Ditto syncs at the document level, it can synchronize only the relevant documents or even specific fields (deltas) to each peer, conserving bandwidth and storage.
JSON Database
Data in Ditto is stored as JSON-like documents, making it a flexible, document-oriented database. This schemaless JSON data model means you can store structured objects without defining a rigid schema up front - your documents can have arbitrary fields, nested sub-objects, and evolve over time as your application needs change. Each document is saved in the local embedded database on the device, and Ditto provides DQL, an expressive SQL-like query language, to work with this data. You can query documents using familiar query syntax with advanced filters, sorting, and transactions, allowing the app to efficiently find and update the data it needs. The JSON document approach not only gives developers flexibility in modeling data, but it also pairs naturally with Ditto’s sync engine - any change to a JSON document (like adding a field or updating a value) will be captured and propagated to other devices in the network. This combination of a developer-friendly data format with powerful local queries and seamless syncing makes it straightforward to build data-rich features that work reliably online or offline.
Was this page helpful?