Sync App Flow — The Batch Syncer
Why This Matters
The Batch Syncer is what makes full sync practical. Without it, every full sync would send thousands of unchanged records to Data Service. Understanding how it works explains why SyncApp can run full syncs efficiently.
What You'll Learn
- What a 'batch' is: a key-value store mapping entity ID → hash of the transformed record
- How the Batch Syncer compares current hash to stored hash to detect changes
- The three outcomes: hash unchanged (skip), hash changed (send to Data Service), ID not found (new record, send to Data Service)
- One batch file per entity type: patient batch, appointment batch, order batch, etc.
- Why Batch Syncer is particularly important for on-prem PMSs that always do full fetches
Watch Video
Lesson Summary
When SyncApp fetches all data (full sync), it can't just blindly send everything to Data Service. The Batch Syncer solves this: after transforming each record, SyncApp checks its batch file — a map from entity ID to hash of the last sent record. If the new hash matches, skip. If it differs, the record was modified and must be sent. If the ID doesn't exist in the batch, it's a new record — send it. This way, even on full sync cycles, only the delta is transmitted over the network. Each entity type has its own batch file (patient-batch, appointment-batch, etc.).