Data synchronization

Also known as: data sync · two-way sync · bidirectional sync

On this page 7

Data synchronization is the continuous or scheduled process of keeping the same records consistent across two or more systems by detecting changes in one place and applying them in the others. In system integration and automation, it is what keeps a CRM, a billing platform and a support desk showing the same customer address, even though each system stores its own copy.

Synchronization can run in one direction, from a source of truth to its consumers, or in both directions, which is known as two-way sync or bidirectional sync. The second form is far harder, because the process must decide what happens when the same record changes in two places before either change has been propagated.

How data synchronization works

Every data sync follows the same cycle: detect changes, map them, apply them and record the result. Change detection identifies which records were created, updated or deleted since the last run. Data mapping translates fields from the source schema into the target schema. The apply step writes the changes, and a sync state store remembers what was processed, so the next run starts from the right point.

The choice of change detection method shapes latency, load and reliability. Polling with a modified-since timestamp is simple but adds delay and misses hard deletes. Webhooks push events immediately but can be lost if the receiver is down. Change data capture reads the database log and captures every change, including deletes, at the cost of deeper access to the source.

MethodTypical latencyStrengthWeakness
Timestamp polling1 to 60 minutesWorks with almost any APIMisses deletes, clock issues
WebhooksSecondsNear real time, low loadEvents can be lost or duplicated
Change data captureSub-second to secondsComplete change historyNeeds log access
Full comparisonHoursCatches every differenceExpensive on large data sets
Change detection methods used in data synchronization

Robust designs often combine a fast method with a slow one: webhooks deliver changes quickly, and a nightly full comparison, sometimes called a reconciliation run, repairs anything the event stream missed.

One-way and two-way sync patterns

The direction of flow determines how complex a sync is. One-way sync has a clear owner for each field, so conflicts cannot occur by design. Two-way sync lets users edit in either system, which is convenient but requires conflict resolution rules, loop prevention and careful handling of deletes.

PatternData flowTypical useMain risk
One-waySource to targetFeeding a data warehouseTarget edits are overwritten
Two-wayBoth directionsCRM and help desk contactsConflicts and update loops
Hub and spokeCentral hub to many systemsMaster data distributionHub becomes a bottleneck
Field-level ownershipEach field has one sourceMixed ownership recordsOwnership rules drift
Synchronization patterns and when they apply

A frequent and effective compromise is field-level ownership: the record syncs in both directions, but each field has exactly one authoritative system. Billing owns the payment terms, the CRM owns the account manager, and neither overwrites the other.

Conflict resolution and consistency

A conflict occurs when a record changes in two systems within the same sync window. The sync engine needs a deterministic rule to decide the outcome, and the rule must be documented, because users will otherwise perceive lost edits as random data loss.

StrategyHow it decidesBest suited for
Last writer winsMost recent timestamp prevailsLow-risk descriptive fields
Source priorityA ranked system always winsClear system of record
Field-level mergeNon-overlapping field changes combineRecords edited by different teams
Manual review queueA person decidesFinancial or legal data
Common conflict resolution strategies

Last writer wins depends on reliable, comparable timestamps, and clock skew between systems of even a few seconds can pick the wrong winner. Two-way sync also needs loop prevention: when system A writes to system B, B emits a change event that must not be sent back to A. Engines usually tag their own writes or compare a hash of the record to suppress these echoes.

Synchronized systems are eventually consistent, never instantly identical. Between runs, a user may see an old value in one system, which is acceptable for contact details but not for stock levels or account balances.

Data synchronization is one of several ways to connect systems, and it is easy to confuse with its neighbors. It maintains copies of state, whereas API integration often reads data on demand without storing it, and a message queue moves individual events without guaranteeing that two stores end up matching.

  • API integration on demand avoids copies but depends on the other system being available at read time.
  • Data replication copies a database exactly, usually within one technology, without schema mapping.
  • ETL pipelines move data in batches for analytics, normally in one direction only.
  • Message queues transport events reliably but leave state reconciliation to the consumers.

Pitfalls in synchronization projects

Most sync failures come from identity and deletion problems, not from transport. Records need a stable external ID mapping between systems; matching on email address or name produces duplicates as soon as either value changes. Deletes are frequently ignored, so records removed in one system live on indefinitely in another.

  • Missing idempotency: replaying a batch creates duplicate records.
  • API rate limits: initial loads of large data sets exceed quotas and stall.
  • Silent mapping errors: a changed picklist value fails without any alert.
  • No reconciliation: small drifts accumulate unnoticed for months.

A sound practice is to monitor sync lag and error counts as operational metrics, keep a dead letter store for records that fail repeatedly, and run a periodic comparison that reports the number of mismatched records.

Understanding it simply

Imagine two people keeping the same address book, one at home and one at the office. Whenever one of them adds or changes a contact, they phone the other so both books match. Data synchronization is that phone call, done automatically between computer systems.

The tricky part is when both people change the same contact before calling each other. Someone has to decide which version is right, and the rules for that decision are the heart of a good sync setup.

Applied in practice

A software company runs its sales team on a CRM and its support team on a help desk platform. Account contacts were typed into both systems by hand, and support agents often emailed people who had already left the customer organization.

The integration team set up a two-way sync of about 40,000 contacts using webhooks for changes and a nightly reconciliation run. Each field received an owner: the CRM owns job title and account, while the help desk owns the support tier and preferred language. Conflicts on shared fields go to a review queue. After rollout, duplicate contacts fell sharply and both teams worked from the same, current contact data within a few minutes of every change.