How do you implement cross-system data synchronization workflows?
Cross-system data synchronization maintains consistency across multiple business applications. Patterns: request-reply (synchronous API calls for real-time sync), publish-subscribe (event-driven for near-real-time), batch sync (scheduled bulk transfers for high volume), and hybrid (real-time for critical data, batch for bulk). Architecture: define a canonical data model as the common schema, implement source-specific adapters for transformation, use a message broker (Kafka, RabbitMQ) for event routing, and maintain sync state tracking (last sync timestamp, cursor position, change tokens). Conflict resolution strategies: last-write-wins (simplest but can lose data), source-of-truth designation per data field, merge rules based on business logic, and manual conflict resolution queue for ambiguous cases. Implementation: build idempotent sync operations, implement change detection (CDC, polling, or webhook-based), handle schema evolution with backward-compatible changes, and maintain a reconciliation process that periodically compares datasets. Error handling: dead letter queue for failed sync events, automated retry with exponential backoff, alerting on sync lag exceeding SLA, and a reconciliation dashboard showing sync health metrics. Scale considerations: partition data for parallel processing, implement rate limiting to respect API quotas, and use bulk APIs where available for batch operations.