Back to all posts
Backend7 min read·October 25, 2026

How to Prevent Conflicts in Two-Way Data Sync

TB
ThynkBlox Team
Engineering

How should you handle two-way data sync conflict resolution?

Two-way data sync conflict resolution needs explicit rules for who controls each field and what happens when both systems change it. Start with stable record identifiers, compare changes against a shared version, and define separate rules for updates and deletions. Choosing the latest update alone can discard valid information, so make unresolved conflicts visible and check that both systems eventually agree.

The goal is not to prevent people from working in both systems. It is to make the outcome predictable when their work overlaps.

Which system should control each field?

Avoid declaring both systems equally authoritative for every value. Instead, write an ownership table that describes where each field may change and how competing edits should be handled.

Consider this illustrative arrangement between a customer portal and an operations application:

FieldWho controls it?Rule for competing changes
Customer display nameEither systemReview different edits to the same starting value
Delivery instructionsCustomer portalOperations may suggest a change but cannot silently replace it
Fulfilment statusOperations applicationReject unsupported changes from the portal
Internal notesOperations applicationKeep private; do not copy to the portal
Contact preferencesCustomer portalAccept only permitted, validated changes

Ownership should reflect responsibility. The system responsible for fulfilment should decide which fulfilment transitions are valid.

Also define what each destination can represent. If one system supports several delivery addresses and the other supports only one, decide which address crosses the boundary. Do not let a narrower record silently erase richer information.

How do you identify the same record in both systems?

Give every synchronised record a stable identity. If each system already assigns its own identifier, maintain an explicit mapping between them.

Avoid using an editable email address, phone number or name as the sole matching key. In this design, changing an email should update an existing customer, not create a new customer.

Plan for records created independently on both sides. A matching name can be a reason to investigate, but should not automatically authorise a merge. Define which evidence permits automatic matching and which cases need review.

Treat delivery identity separately from record identity. Give each change an identifier so the receiver can recognise a retry. Accepting the same change again should leave the same result, rather than creating another note, order or adjustment.

What counts as a conflict?

Use the last successfully shared version as the starting point for comparison.

Ask what changed in each system since that version:

  • If only one side changed a field, apply that change after validation.
  • If both sides chose the same value, accept the agreement.
  • If they changed different, independent fields, combine those changes.
  • If they changed the same field differently, apply its conflict rule.

A conflict is not simply two deliveries arriving close together. It is competing changes that cannot both be accepted under the agreed rules.

Before writing a resolution, check that the destination still has the version you inspected. If someone edited it during the decision, compare again. Otherwise, the resolution itself could overwrite another valid edit.

Keep version tokens separate from business values. A version token helps answer “Has this record changed since I read it?” It does not decide whose choice is correct.

Why can choosing the latest update lose information?

Consider this illustrative example. Both systems begin with the same customer record:

  • Delivery instructions: “Use the main entrance.”
  • Contact preference: “Email.”

A customer changes the delivery instructions in the portal. Separately, an operator changes the contact preference in the operations application.

If sync selects one complete record because its update time is later, one valid change disappears. Comparing individual fields against the shared starting version would preserve both.

Now suppose both people edit the delivery instructions. Combining the text automatically may produce contradictory directions. That needs an ownership rule or a review decision.

Use timestamps to show when activity was recorded, but do not treat a later timestamp as proof of business authority. Define which event the timestamp describes: the original edit, receipt by the other system or completion of sync. A delayed delivery should not acquire priority merely because it arrived later.

Reserve latest-update rules for fields where discarding an earlier competing value is an explicitly accepted trade-off.

How should deletions work?

Treat deletion as a distinct action with its own policy. Decide whether it means archive, removal from one system or removal everywhere.

Require an explicit deletion marker that identifies the record and its version. Do not interpret absence from a partial response, filtered list or failed request as permission to delete.

Define what happens when deletion meets an update. For example, an archived customer might receive a delayed address change. Should the change be rejected, retained for review or allowed to restore the record? Choose deliberately.

Retain deletion markers until every relevant participant has acknowledged them, or require a fresh baseline before an old participant reconnects. Include backup restoration in this rule so an older copy cannot silently recreate removed records.

Set retention and access rules for deletion history too. Review what must be retained and who may see it alongside your wider approach to data security.

Which conflicts should be resolved automatically?

Automate decisions whose meaning you can explain and test.

SituationSuggested response
One side changes an owned fieldAccept the owner's valid change
Both sides choose the same valueRecord agreement
Different independent fields changeCombine the changes
The same field receives different valuesUse an explicit rule or request review
A deletion competes with an updateApply the deletion policy
A change violates a business ruleReject it with a clear reason

Check relationships between fields before combining them. A delivery method and its required address may form one business decision, even though they occupy separate fields.

For quantities or balances, distinguish “set the value” from “apply an adjustment”. Do not add two final values together and assume that preserves intent. If independent adjustments must survive, design and deduplicate those operations explicitly.

A review screen should show the shared starting value, both proposed values and the consequence of each choice. Preserve unresolved proposals rather than replacing them with an unexplained error.

How do you check that both systems agree?

Add reconciliation: a separate process that compares records against the expected shared state.

Compare mapped identifiers, permitted field values, versions and deletion markers. Exclude intentionally private fields and account for agreed formatting differences.

Separate pending delivery from confirmed disagreement. A change still awaiting acknowledgement should not immediately become a manual conflict.

Give each discrepancy a clear outcome: retry delivery, repair a mapping, apply an authorised correction or request review. Check again after the action to confirm agreement.

Record enough history to explain what changed, which rule applied and whether the destination accepted it. Keep sensitive values out of routine logs.

Turn these scenarios into acceptance checks; the same discipline belongs in software testing and quality assurance.

What common mistakes should you avoid?

  • Copying whole records for small edits. Specify which fields changed.
  • Treating missing fields as empty values. Distinguish omission, clearing and deletion.
  • Sending changes back indefinitely. Preserve their origin and recognise applied changes.
  • Acknowledging before acceptance. Confirm success only after the destination has accepted and saved the change.
  • Hiding conflicts in logs. Assign an owner and provide a review path.
  • Assuming every field needs two-way sync. Prefer one-way ownership where it meets the need.

Before launch, test simultaneous edits, repeated delivery, delayed updates, interrupted connections, deletion followed by an old update, and edits made during conflict review.

What else should you know about two-way sync?

Do both systems need identical records?

No. Define the shared fields and permitted transformations. Private notes, calculated values and local workflow details can remain in their owning system.

Can every conflict be resolved automatically?

Require automatic rules to preserve the intended business meaning. When two valid choices compete and no agreed rule selects one, send the decision to someone authorised to make it.

Is two-way sync always necessary?

No. If one system creates and controls the data while the other only displays it, one-way sync may meet the requirement with fewer decisions.

What should a product owner approve before development?

Approve the ownership table, identity rules, deletion behaviour, automatic resolutions and review process. Ask for worked examples showing what users will see when edits compete.


*Need two applications to share data reliably? Start a conversation →*

Ready to build?

Let's turn these ideas into your next product.

Start your project