Key takeaway
Do not let the last save silently overwrite. Check a version token for the whole record, or compare field differences and let the user choose. A conflict prompt shows both versions, who changed what, and when, not just 'save failed'. Locks must be short, visible, and expiring.

Take this illustrative scenario. Sales opens a customer record and changes the delivery address from the old park to the new one. At almost the same moment, customer service opens the same customer and raises the credit limit from 200,000 to 300,000. Service notices that sales is editing, thinks nothing of it, and both click Save. Service's save lands last, the system overwrites the database with her full copy, and the new address reverts to the old one.
No error appears, and nobody did anything wrong. The system simply used the most common default: last save wins. That is fine for a record only one person touches. For customers, orders, and stock edited by several roles, it silently loses data.
Why last-save-wins is dangerous
Because the loss is silent. Sales believes the address is saved; service believes the limit is updated. Days later a shipment goes to the wrong place before anyone discovers the address is old. By then the log shows two saves, but no record that an address was overwritten.
Business records often hold fields owned by different roles: sales owns address and contacts, service owns credit and preferences, finance owns settlement. One person saving the whole record overwrites a field someone else just changed.
Three ways to handle it
Overwrite. The later save replaces the earlier one. It fits low-risk cases where one person edits, or fields never overlap. Even then, keep both versions.
Version check. Each user receives a version token when opening the record and sends it back on save. If the stored version has changed, the system refuses the save and says the record was modified while you were editing. This is the most common and comparatively cheap approach.
Field-level merge. The system compares both versions and lists the fields that actually changed. Different fields can merge automatically; the same field changed twice goes to the user.
The three can combine: a version check blocks the conflict, and the prompt then shows a field-level comparison so the user can see what differs.
Use ETag or a version number
In HTTP APIs, a common pattern returns an ETag, and the client sends If-Match when saving. Under RFC 9110, an ETag is an opaque validator for the selected representation, and If-Match makes the request conditional on the current representation still matching that validator. When it does not match, the server must not perform the method and may return 412 Precondition Failed.
This mechanism is commonly used to prevent lost updates when multiple clients modify the same resource concurrently. Even without HTTP, the principle is the same: the record carries a version, the save checks it, and a mismatch is not silently overwritten.
Update the version after every successful save. A timestamp is not a version: two edits within the same second can share a timestamp, while versions must differ.
What a conflict prompt must show
"Save failed, try again" invites the user to click Save again and overwrite anyway. A conflict prompt should show at least:
- Who changed the record after you opened it, and when.
- Which fields you changed and which fields they changed.
- The specific differences, ideally side by side.
- Choices: keep mine, keep theirs, choose per field, discard my changes.
The prompt is not for developers. Use business field names and readable values. Money carries a currency, dates carry a time zone, statuses show names rather than codes.
Record the resolution: which version was kept, which fields came from which side, and who decided. This was not an ordinary save but a merge, and an audit needs to explain it.
Limits of field-level merging
Changes to different fields usually merge. Sales changed the address, service changed the limit; both new values survive.
Some fields depend on each other. A credit limit change can affect whether an order continues; a customer tier change can affect pricing; an address change can affect tax and shipping. Even when the fields do not collide on the surface, a merge should trigger review rather than apply silently.
When both people change the same field to different values, do not automatically pick the later one. Show both values and reasons, and let someone decide. Money, status, permissions, and external commitments should require human confirmation by default.
When to use a lock
Version checks fit most editing. A few cases need a lock: long edits, continuous numbering, or operations that must be exclusive, such as financial close, stock counts, and bulk repricing.
A lock must be short, visible, and expiring. Keep it as brief as possible; show others who holds it and since when; release it automatically on timeout so a closed browser does not lock a record forever.
Do not use locks instead of version checks. Locks reduce conflicts but do not eliminate them; users can call the API directly, or the lock can expire just before save. The version check is the last line of defense.
A hypothetical case: address and credit limit changed together
Field | Sales version | Service version | Auto-merge | Result |
|---|---|---|---|---|
Delivery address | New park, building A | Old park, building B | Yes, different fields | Sales's new address kept |
Credit limit | 200,000 | 300,000 | Different fields; can merge | Service's 300,000 kept, but order review triggered |
Contact phone | Unchanged | Unchanged | Not applicable | Unchanged |
A merged result is not the end because both sides are satisfied. A credit-limit change affects unshipped orders; the system should create a review task instead of letting the new limit take effect directly.
A conflict checklist
[Concurrent editing checklist]
1. Conflict scope
- Which records are edited by several people:
- Which fields belong to which roles:
- Are money, status, and permission fields handled separately:
2. Detection and merge
- Is a version number or ETag checked:
- Does the version update after every successful save:
- Can different fields merge; does a same-field conflict ask the user:
3. Prompt and record
- Does the prompt show who changed what, and when, with both versions:
- Can the user choose per field:
- Is the merge result recorded:
4. Locking
- Which scenarios need a lock; its duration and expiry:
- Can others see why the record is locked:
- How is the record recovered after the lock expires:Take one customer or order record that several people edit and simulate two people changing different fields and the same field. If the system only says "save failed" in both cases, conflict handling is not designed yet.
Merging duplicate customer records is a different problem; this article covers only simultaneous editing of one record. How roles limit which fields a person may change belongs in business system development. How to inventory fields and owners is covered in the system preparation guide.