Skip to main content
This content is for SDK V4. For the latest version, see the V5 documentation.
This feature requires SDK version 4.12.0+ and an active Ditto Cloud subscription.
This guide provides detailed patterns and examples for tracking synchronization between your Edge SDK device and Ditto Cloud servers. Use these patterns to ensure critical data reaches the cloud and provide sync feedback in your application.

Understanding Ditto Cloud Sync

Ditto Cloud servers act as the source of truth in most deployments. Tracking sync status with the cloud is crucial for:
  • Critical Operations - Verify important data reached the cloud before proceeding
  • User UI/UX Feedback - Show sync indicators when local commits haven’t uploaded
  • Offline Handling - Know when devices reconnect and sync resumes
  • Data Integrity - Ensure passenger manifests, orders, or transactions are safely stored

Quick Start

Check Cloud Connection

The system:data_sync_info collection can be used to find and track cloud server connections. To query for the Ditto Server (e.g. Cloud) connections only use the following DQL Query.
DQL
Check if you’re connected to the cloud:

Verify Data Reached Cloud

Track when specific local commits reach the cloud:

Real-Time Sync Monitoring

Connection Status Observer

Monitor cloud connection Commits in real-time:
Observers on system:data_sync_info result in the callback triggering every 500ms even when the result remains the same. This frequency can be configured using the live_query_system_collection_refresh_interval system parameter.

Track Pending Cloud Syncs

Track multiple local commits and monitor when they sync to the cloud:

Monitor Incoming Cloud Data

Register an observer to track when new data arrives from the cloud by monitoring commits to last_update_received_time:
Observers on system:data_sync_info result in the callback triggering every 500ms even when the result remains the same. This frequency can be configured using the live_query_system_collection_refresh_interval system parameter.

Troubleshooting

  • Verify cloud connection status - Use the connection check examples above
  • Check subscription configuration - Ensure your sync subscriptions are properly configured
  • Ensure device has network connectivity - Test basic internet connectivity
  • Verify Ditto Cloud permissions - Check authentication and access permissions
  • Check network connectivity - Verify internet connection is stable
  • Verify cloud credentials - Ensure authentication tokens are valid
  • Review transport configurations - Check WebSocket and network settings
  • Check firewall/proxy settings - Ensure Ditto Cloud endpoints are accessible
  • Large backlog of commits to sync - Consider reducing data volume or batch size
  • Poor network conditions - Wait for better connectivity or optimize for low bandwidth
  • Subscription recently changed - New subscriptions need time to sync historical data

See Also