Prompt
How do I keep inventory data synced across systems
Latest observation
Keeping inventory data synced across systems usually comes down to choosing one source of truth, defining reliable sync rules, and using integration patterns that handle delays, conflicts, and failures.
1) Pick a system of record
Decide which system is authoritative for each type of inventory data:
- On-hand quantity: usually ERP/WMS
- Reserved stock: order management or WMS
- Product master data: PIM/ERP
- Channel listings: e-commerce platform or marketplace connector
If multiple systems can edit the same field, sync becomes much harder.
2) Use event-driven updates where possible
Instead of batch-only syncing, send updates when inventory changes:
- sale completed
- return received
- stock adjusted
- purchase order received
- transfer shipped/received
Common pattern:
- source system emits an event
- integration layer transforms it
- destination systems update their records
3) Maintain a canonical data model
Standardize fields across systems:
- SKU / item ID
- location / warehouse
- available quantity
- reserved quantity
- on-hand quantity
- unit of measure
- timestamps / version numbers
This prevents mapping chaos between different schemas.
4) Use idempotent updates
Make sure the same update can be applied more than once without causing errors. Example:
- send
inventory_adjustment_id - destination ignores duplicates if it already processed that event
This is important because retries happen.
5) Track versions and timestamps
Add:
updated_atversionlast_synced_at- source event ID
This helps detect stale data and resolve conflicts.
6) Handle conflicts explicitly
Decide what happens if two systems update the same inventory record:
- source wins
- latest timestamp wins
- manual review
- merge by rule
For inventory, it’s often best to avoid conflict by limiting writes to one system per field.
7) Reconcile periodically
Even good event sync can drift. Run scheduled reconciliation jobs:
- compare quantities across systems
- detect missing SKUs
- flag mismatches
- repair discrepancies
Typical cadence:
- every few minutes for critical channels
- nightly full reconciliation
8) Design for failures
Use:
- retries with backoff
- dead-letter queues
- error logs
- alerting
- replayable events
If a downstream system is down, you should still be able to recover without data loss.
9) Support atomicity where needed
If one inventory change must update multiple systems consistently, use a workflow that ensures partial failures are handled:
- transactional outbox
- saga pattern
- queue-based processing
Avoid relying on “update everything at once” without recovery logic.
10) Monitor sync health
Track:
- sync latency
- failed events
- mismatch rate
- queue depth
- last successful sync per system
This makes issues visible before they affect orders.
Practical architecture options
Simple setup
- ERP is source of truth
- nightly batch export/import
- manual reconciliation
Good for small catalogs and low order volume.
Mid-scale setup
- ERP/WMS source of truth
- integration platform or middleware
- near-real-time webhooks/events
- reconciliation job
Good for growing businesses.
Larger setup
- event-driven architecture
- message broker
- canonical inventory service
- per-channel adapters
- strong observability and replay
Good for multi-warehouse, multi-channel operations.
Best practices summary
- Keep one master source for inventory quantities
- Sync via events/API, not only spreadsheets or manual entry
- Use unique IDs, timestamps, and idempotency
- Reconcile regularly
- Build robust retry and alerting mechanisms
If you want, I can also give you:
- a sample inventory sync architecture,
- a database schema for synced inventory, or
- a step-by-step approach for Shopify/Amazon/ERP syncing.