# Can CRDT synchronization resolve an offline stock conflict?

Understand what conflict-free synchronization resolves. Use an offline stock example to separate converged data, competing requests and valid allocations.

By Daltn editorial team. Published 2026-11-08.
Canonical: https://daltn.tech/feeds/crdt-synchronization-business-conflicts/

## Can CRDT synchronization resolve an offline stock conflict?

CRDTs can help replicas converge after concurrent changes, while a converged record can still contain a business conflict. Two valid offline requests may together exceed available stock or compete for one appointment. Preserve changes, define the business rule and resolve consequential allocations through appropriate authority rather than assuming merging establishes correctness.

## Keep these in mind

- Replica convergence differs from a valid business decision.
- Concurrent requests can both be preserved while remaining incompatible.
- Design the review and authority rule alongside synchronization.

## Conflict-free describes a technical property

A replicated data structure can allow devices to edit locally and later combine changes using defined rules. The devices can reach the same state after receiving the required updates.

That agreement does not establish that every resulting commitment is feasible. A merged note and an accepted stock allocation involve different questions. The application must define what the combined information means for the business.

## Read the local-first and conflict mechanisms together

The 2019 [Ink & Switch local-first essay](https://www.inkandswitch.com/essay/local-first/) discusses CRDTs as a foundation for collaborative local software. It also examines user-interface and ownership challenges.

[Automerge’s conflict documentation](https://automerge.org/docs/reference/documents/conflicts/) describes how concurrent values can be retained and inspected. A visible winning property value does not necessarily mean the alternative value was never proposed.

These mechanisms support data convergence and inspection. Whether the resulting state satisfies an inventory, payment or booking rule is an additional application question.

## Use an illustrative five-unit stock case

Suppose a team begins with five available units. While disconnected, one employee requests four units for order A and another requests three for order B. Preserving both requests reveals demand for seven units.

The information can converge correctly while allocation remains unresolved. The business has a two-unit shortfall under these stated assumptions. Silently choosing one request or accepting both would introduce a separate decision.

Event | Units | Meaning
--- | --- | ---
Initially available | 5 | Accepted starting quantity
Employee one requests order A | 4 | Proposed allocation while disconnected
Employee two requests order B | 3 | Another proposed allocation
Combined requested quantity | 7 | Both intentions remain visible
Unresolved difference | 2 | Business must decide how to satisfy or revise demand

## Define which operations can be provisional

A note or draft request may be safe to create offline. A final promise involving scarce stock may require a reservation authority, an established allocation mechanism or later approval. Choose the rule deliberately.

Show provisional status to staff and customers where relevant. A local save should not look like a globally accepted allocation if another device can still propose competing demand.

The appropriate design depends on the business requirement. Some systems can use bounded reservations; others may need to defer consequential acceptance until current shared state is available.

## Test meaning after synchronization, not only equal bytes

Run a controlled exercise with two devices making concurrent changes. Confirm that both intentions remain inspectable and that the interface identifies the unresolved business issue.

Also test a cancellation, corrected quantity and user access change. A technical merge can preserve operations while leaving the application unsure which approval or identity should govern the next action.

Keep source and decision history accessible to authorized reviewers. They need enough context to resolve the allocation without asking both operators to reconstruct their work from memory.

## Make the resolution an accepted business event

When the responsible person revises or accepts allocations, record that decision explicitly. Preserve the relationship to the competing requests so colleagues understand why the final quantity differs from their initial proposal.

Synchronization should then distribute the accepted resolution. Reaching the same current state is useful, while the business decision that established it should remain clear.

1. Classify local changes as notes, proposals or commitments.
1. Define the invariant that accepted outcomes must satisfy.
1. Test concurrent changes and inspect their combined meaning.
1. Record an authorized resolution and verify its distribution.

## Common questions

### Does conflict-free mean users never need to resolve a disagreement?

The term concerns the data structure’s convergence behavior. Concurrent edits can still express incompatible business intentions. Preserve the relevant values and apply an explicit decision process for stock, pricing, approvals or other consequential commitments.

### Should every offline change become final immediately?

Decide according to its consequence and available authority. A local note can be durable while an allocation remains provisional. Show that distinction clearly and define how the system establishes a final accepted state after competing changes become visible.

## Sources

- [Ink & Switch: Local-first software](https://www.inkandswitch.com/essay/local-first/): April2019 collaborative-local software principles; convergence does not itself establish business invariants.
- [Automerge documentation: Conflicts](https://automerge.org/docs/reference/documents/conflicts/): Supports retained concurrent values and inspectable conflicts in its data model.
