Intent
Keep two systems consistent by detecting and applying drift in a repeatable loop.
When to use
- Two systems must remain aligned over time.
- The source of truth can change frequently.
- Manual reconciliation is too slow or error-prone.
Core mechanics
- Identify a source of truth and a target system.
- Fetch both states and compute a deterministic diff.
- Apply changes with idempotent safeguards.
- Record actions and outcomes for auditability.
Implementation checklist
- Define sync rules and conflict resolution.
- Build a diff phase and a dry-run mode.
- Add rate limiting and retries for APIs.
- Store audit logs and summaries per run.
- Schedule and monitor sync cadence.
Failure modes and mitigations
- Rate limits or API errors -> backoff, retry, and checkpointing.
- Partial runs -> resume from checkpoints and re-run diffs.
- Conflicting updates -> prioritize source of truth and log overrides.
Observability and validation
- Planned vs applied changes per run.
- Error rates and failure categories.
- Sync lag and last successful run time.
Artifacts
- Diff reports and audit logs.
- Sync summaries with counts and timing.