This feature is available in SDK version 4.12.0 and later.
This feature works fully with with DQL Strict Mode disabled.
DQL_STRICT_MODE=false
Read more about STRICT MODE and upcoming v5 behaviorsystem:data_sync_info
collection provides real-time information about synchronization status between your device and other peers in the Ditto mesh network.
What You Can Monitor
- Connection status with peers and cloud servers
- Sync progress using commit IDs
- Last update timing from each peer
Document Structure
Each document insystem:data_sync_info
represents one peer connection:
Key Fields
_id
- Unique peer identifieris_ditto_server
-true
for cloud servers,false
for other devicessync_session_status
-"Connected"
,"Not Connected"
, or"Disabled"
synced_up_to_local_commit_id
- Latest commit ID synced to this peerlast_update_received_time
- Unix timestamp of last data received
Basic Queries
The examples in this document assume DQL Strict Mode is disabled.If DQL Strict Mode is enabled the collection definition must be provided.
COLLECTION system:data_sync_info (documents MAP)
Read more about STRICT MODE and upcoming v5 behaviorGet All Peers
Get Only Cloud Servers
Get Connected Peers Only
Get Specific Fields
Example in Code
Observing Changes
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.registerObserver
to monitor sync status changes in real-time:
Using Commit IDs
Every data modification returns a commit ID that you can use to track sync progress:synced_up_to_local_commit_id
to see if a peer has received your change.
Important Notes
Sync status information is local-only and never synchronizes between peers. Each peer maintains its own view of sync status.
- Commit IDs are monotonic (always increasing) but not necessarily sequential
- Multiple cloud servers may appear due to load balancing or failover
- Local-only data - this collection exists only on your device
- Minimal performance impact - observing sync status is lightweight
Supported APIs
API/Feature | Index Support |
---|---|
execute SDK API | ✅ Supported |
registerObserver SDK API | ✅ Supported |
registerSubscription SDK API | ❌ Not Supported |
Big Peer HTTP API | ❌ Not Supported |
SDKs with in-memory storage (e.g. web browser) | ❌ Not Supported |
Related Topics
- Track Ditto Cloud Sync Status - Monitor cloud synchronization specifically
- Managing Subscriptions - Configure what data syncs between peers