Academy / Sync App Flow & Deployment / Sync App Flow — The Batch Syncer

Sync App Flow — The Batch Syncer

Lesson 5.3 ⏱ ~8 min

💡 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

Open in Google Drive 💡 Open in Drive for AI-powered transcript search and summaries

📋 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.).

🏷 Key Concepts

Batch Syncer Batch File Entity ID → Hash Map Hash Comparison New Record Detection Modified Record Detection Network Efficiency Per-Entity Batch Files

Key Takeaways

01Batch Syncer turns a potentially massive full sync into a minimal network payload
02The batch file is a simple key-value map: entity ID → hash of last-sent transformed record
03Three outcomes per record: skip (hash same), update (hash different), create (new ID)
04For on-prem PMSs, the Batch Syncer is the primary optimization that makes full syncs fast
05If batch files are deleted or corrupted, SyncApp will re-send all records on the next cycle — a full resync