Skip to main content
This content is for SDK V4. For the latest version, see the V5 documentation.
This feature is available in SDK version 4.12.0 and later.
Every data modification in Ditto returns a commit ID that you can use to track when that specific commit reaches other peers in your mesh network.

What Are Commit IDs?

Commit IDs are unique, monotonically increasing identifiers assigned to each data modification on your device:

Key Properties

  • Monotonic - Always increasing (1547, 1548, 1549…)
  • Device-specific - Each device has its own sequence
  • Per-operation - Every INSERT, UPDATE, DELETE gets a new ID
  • Trackable - Use with system:data_sync_info to monitor sync progress

Tracking Sync Progress

Compare your commit ID with synced_up_to_local_commit_id to see if peers have received your commit:

Monitoring Multiple Commits

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 several commits and watch them sync in order:

Transaction Behavior

Commit IDs are only assigned after transactions complete:

Checking Specific Peers

Track sync progress to any peer (not just cloud servers):

Best Practices

Remember that Ditto is offline-first. Use commit ID tracking to enhance user experience, not to block operations.
  • Don’t block operations - Let users continue working while tracking sync in background
  • Show progress indicators - Use commit tracking to display sync status in your UI
  • Handle concurrency gracefully - Tracking should enhance the experience, not block it
  • Monitor critical data - Focus tracking on important operations like payments or submissions
  • Clean up tracking - Remove old commit IDs from your tracking lists to avoid memory issues