The Ditto MongoDB Connector: Seamlessly Sync Edge and Cloud Data

Mariia Kozhyna

Picture a delivery service that uses mobile devices for real-time tracking of packages, routes, and customer interactions. The mobile app on drivers' phones must sync with a cloud database (such as MongoDB Atlas) to update customer addresses, schedules, and tracking info for backend processing. In remote areas with poor internet, instant syncing might not be possible, leading to inconsistencies and delays if field data doesn’t sync immediately. Simultaneous updates to both the mobile app and the cloud could also cause data conflicts, resulting in confusion and potential data loss.

And this is just one example from hundreds. In the logistics & supply chain industry, companies depend on a vast array of edge sensors (like temperature-controlled shipping containers or GPS trackers) and need constant, real-time data updates. In the healthcare industry, patient data collected from wearables or remote monitoring devices must be instantly synced with cloud-based databases for analysis. In the finance industry, mobile banking and real-time trading platforms require instant data synchronization with cloud databases without delays for accurate decision-making. In sum, syncing mobile data in real-world environments is a challenge across industries.

The solution: Ditto’s bidirectional connector for MongoDB

To address these challenges, we’re excited to introduce the Ditto MongoDB Connector. This solution, a collaboration between Ditto and MongoDB, delivers robust, real-time, bidirectional data synchronization between local apps, Ditto Big Peer, a centralized synchronization engine, and MongoDB Atlas, a robust cloud-based non-relational database. By integrating these technologies, applications can operate effectively even when offline and synchronize changes into the cloud once connectivity is restored. This enhances user satisfaction and fosters trust in digital products.

Seamless architecture for real-time synchronization

Once the Ditto SDK is integrated into your application, each device running your app maintains a local database. Additionally, these devices automatically form a peer-to-peer (P2P) mesh network and synchronize using available transport protocols such as Bluetooth Low Energy (LE), Local Area Network (LAN), or peer-to-peer Wi-Fi (P2P). The Small Peers connect to the Ditto Big Peer, which serves as a centralized cloud datastore and synchronization engine.

The Ditto MongoDB Connector works in tandem with Ditto Big Peer, facilitating data synchronization between a MongoDB Atlas cluster and Ditto Big Peer. It efficiently handles this synchronization by utilizing Conflict-free Replicated Data Types (CRDTs) to resolve conflicts and update both systems with accurate data, preserving changes even when documents are updated simultaneously in both MongoDB Atlas and Ditto.

The data between devices stream through Ditto Big Peer using the Ditto MongoDB Connector before being stored in a MongoDB Atlas cluster. Conversely, any changes in a cluster are shared with devices via Ditto Big Peer.

Architecture diagram of peer-to-peer (P2P) mesh network connected to Ditto Big Peer and MongoDB cluster via the MongoDB Connector for real-time data synchronization.
Figure 1.  Distributed Data Synchronization Architecture for MongoDB Atlas and Ditto Big Peer.

Telemetry data handling

Real-time information flow is essential across various edge use cases, whether it involves synchronizing telemetry data from edge devices to the cloud or distributing user-initiated updates across devices. The Ditto MongoDB Connector ensures continuous telemetry data synchronization with minimal latency, thanks to a strategy of transferring only deltas—small changes—rather than entire datasets. This significantly improves synchronization speed and reduces data transfer, resulting in fast and seamless updates.

Offline-first capabilities: Critical for Field Operations

When a device loses connection to the cloud due to poor network conditions or intermittent connectivity, the Ditto MongoDB Connector ensures that changes made locally on the device are queued up and synced back to MongoDB once connectivity is restored. This guarantees data is never lost and ensures consistency across all devices and cloud systems.

Robust data security and compliance

Security and compliance are critical for modern enterprises, especially those handling sensitive data. By utilizing MongoDB Atlas, audited as SOC 2 Type 2 compliant, the Ditto MongoDB Connector assures data integrity and security across its applications.

Whether in healthcare, finance, or other data-sensitive industries, organizations can trust that their data processes meet stringent regulatory standards.

How it works in action

Let’s come back to our example of a delivery driver updating a customer’s address on their mobile app. This change must be reflected not only on the driver’s device but also in the cloud-based MongoDB database. Ditto’s Bidirectional Connector ensures that updates are instantly synced both ways—any data entered or modified in the mobile app is mirrored in MongoDB, and vice versa. This guarantees consistency across all devices and cloud-based systems.

Another example is a salesperson who often finds himself in areas with limited or no network connectivity. With Ditto, mobile apps can continue functioning even offline—storing data locally on the device. Once connectivity is restored, the changes are automatically synced with MongoDB Atlas, ensuring that the cloud database is updated without the risk of data loss or corruption.

A seamless integration for developers and enterprises

Integrating Ditto’s Bidirectional Connector for MongoDB into your system is simple and designed for scalability. Whether you’re building a new IoT solution or enhancing an existing one, this connector helps solve common data synchronization challenges with ease. Developers will appreciate the simplicity of use and flexibility of the connector, which automatically handles data synchronization and conflict resolution. Enterprises can rely on the scalability and robustness of the solution to ensure their edge devices are always connected, even in remote or low-network environments.

Begin your journey

The Ditto MongoDB Connector is now available and ready for integration into your systems! Whether you’re tackling edge-to-cloud data challenges in manufacturing, healthcare, or logistics, this new connector simplifies your workflow and ensures data consistency, even in the most demanding environments.

Data integration between edge devices and the cloud doesn’t have to be complicated. With Ditto’s new Bidirectional Connector for MongoDB, you can ensure real-time, conflict-free synchronization across all your systems—empowering your business to make better, faster decisions with accurate data, wherever it resides.

Want to learn more? Explore Ditto’s comprehensive migration guide to discover how Ditto and MongoDB Atlas enable edge data synchronization. Begin your journey with us today!

Read more about Ditto on its MongoDB partner ecosystem page.