INFINITE UPSIDE

Technology and operations

How do version checks prevent a lost update?

Two successful saves can still leave one person’s work missing.

Two employees open the same customer record. One corrects the phone number. The other changes the delivery address, using an older copy that still contains the old phone number. If the second save replaces the whole record without checking for a newer version, the address can be correct while the phone correction quietly disappears.

Optimistic concurrency is a way to detect that kind of conflict when a change is submitted. The application records which version a person or process read and accepts the update only if the version still matches. If the record changed in the meantime, the application can stop the stale write and ask what should happen next. Detecting a conflict is not the same thing as resolving it.

Follow the missing update

Imagine a fictional order record at version 7. Its address is “10 Oak Street” and its contact phone ends in 1111. At 9:00, Ana and Ben each load that same version. Ana changes the phone to end in 2222 and saves. The system stores her change and marks the record version 8.

Ben has not refreshed. His screen still contains version 7, including the phone ending in 1111. He changes only the address to “40 Pine Street,” but his application sends the entire old record on save. In an unconditional whole-record replacement, the server could store the new address together with the old phone. Ana’s correction is lost even though both people received a success message.

That outcome depends on the application’s actual write behavior. A system that updates only the intended field may avoid this particular whole-record overwrite, while still facing other conflicts if two people change the same field or if fields must remain consistent together. Do not infer the exact cause of a missing value merely from the symptom.

Add a version to the save

In the same fictional sequence, suppose the server accepts a change only when the submitted version matches the current version. Ana sends her update with expected version 7. The server checks the condition and stores her phone correction as version 8. Ben’s later request still expects version 7, so the condition fails. The server does not apply that stale replacement under the stated rule.

Ben’s address change is not yet saved. The system might show the current version, preserve his unsaved entry and let him review the difference. If Ana changed only the phone and Ben intended only the address, a person or a carefully designed merge process can create a new update based on version 8 that keeps the phone and changes the address. That new save must itself be checked because another change could occur during the review.

Amazon DynamoDB’s optimistic-locking documentation describes a version attribute and conditional write for one item. Its named error and implementation are specific to that service. Other databases and applications can use different version tokens or conflict responses.

A version is not a timestamp-shaped decoration

The check and write must be enforced as part of the storage system’s conditional operation. If an application checks version 7, waits, and then performs an unconditional write after another process has saved version 8, the initial check has not protected the final update. A version displayed on a screen is useful only if the write path actually uses a reliable condition.

The scope matters. A version may cover one item, an entire document or another defined unit. Updating only one field can reduce accidental replacement of unrelated fields, but it does not automatically protect a rule spanning multiple records. If changing an address must be coordinated with a shipping instruction in another table, the team needs an appropriate atomic transaction or another explicitly designed workflow. A condition on one record alone does not prove the larger operation is atomic.

Likewise, two individually valid updates can have a business conflict. One user might cancel an order while another approves shipment. Both screens may contain legitimate information, but the application needs a rule for whether the second action is still allowed after the first. Compare the current status and business conditions, not only whether a form contains text.

Where HTTP fits

On the web, a server can provide an entity tag for a representation and a client can use If-Match when requesting a change. HTTP Semantics, RFC 9110 describes this mechanism as a way to prevent lost updates. It uses strong entity-tag comparison: a weak tag does not satisfy the match. If the relevant precondition is false, the server generally does not perform the requested method and responds with 412 Precondition Failed, subject to the standard’s stated exception when it can determine that the change already succeeded.

An entity tag is an opaque validator, not necessarily a human-readable revision number. The server and client must actually implement the conditional request correctly. A client that drops the condition, a server that does not enforce it, or an intermediary workflow that writes elsewhere can leave a gap. Check the specific API’s documentation and behavior.

A 412 response says the condition failed; it does not decide which person’s business decision should win. A useful interface explains that a newer version exists, preserves unsaved work where feasible and gives the user a way to compare or restart the change. Automatically replacing the newer record with the stale form would undo the protection that detected the conflict.

A retry is a new decision

For an independent automated change, the program may be able to read the latest state, recompute the intended update and retry with a bounded limit. For example, an inventory process adding a valid receipt must recheck the current quantity and whether that receipt has already been applied. Blindly resending an old total after a conflict can overwrite intervening work or double-count the receipt.

For a human decision, a retry may need human review. If a contract amount, payment destination or customer instruction changed, an automatic merge of two individually valid edits could create an agreement nobody approved. Show the prior value, the current value and the proposed value when practical, then follow the organization’s normal authorization process.

Conflict detection also differs from duplicate-request protection. A version check can reject a stale state; an idempotency key addresses whether repeated requests should be treated as the same operation under an API’s rules. Some workflows need both. Neither label by itself proves a payment was made once or that every downstream system agreed.

Know the boundaries

Optimistic concurrency is attractive when conflicts are uncommon and checking at save time is cheaper than holding a lock through a long edit. If many writers repeatedly contend for the same item, users may encounter repeated conflicts and retries. Another approach, including a suitably designed lock or queue, may be appropriate for a specific workflow, with its own failure and recovery questions.

Replication is another boundary. A version condition that works against one authoritative item is not automatically a cross-region conflict strategy. Amazon’s concurrency guidance warns that its global tables use last-writer-wins reconciliation for concurrent updates. Verify the actual database, region, consistency and conflict-resolution behavior rather than transferring a single-region example to a distributed system.

Finally, a successful write does not establish that the change was authorized, accurate, delivered to another system or visible to every reader immediately. Security checks, validation, audit history, downstream reconciliation and backups answer different questions. The transaction-isolation guide covers broader interactions between database transactions; a version check is one specific protection within a larger design.

What to ask about a real workflow

Which record and fields are replaced? What token identifies the version a user read? Is the comparison enforced with the write? What response appears when a conflict occurs, and can unsaved work be recovered? Who can decide how to reconcile competing changes? Are retries limited and safe, and does the operation affect other records or services?

Then test the actual sequence with two independent edits in a safe environment. Verify that the second stale save is rejected, that the first saved value remains intact, and that a reviewed retry produces the intended combined result. The win is not a more reassuring error message. It is keeping one person’s completed work from disappearing when someone else presses save.

Explore Infinite Upside

For Vijay Sheth’s personal accounts, read Infinite Upside: Building Wealth With Room to Live, published by Sheth Capital, Inc.

Find your edition · Chapter companion

Explore the work behind ownership

Choose an edition

ABOUT THE CONTRIBUTOR

Luna Lim

DIRECTOR OF FINANCIAL RESEARCH & EDITORIAL STRATEGY

SHETH CAPITAL, INC.

Luna Lim writes about business, investing, and the judgment behind financial decisions. She joined PCH Exotics Inc. as Director of Operations in 2022, working across La Jolla and Miami. Today, she reports directly to Vijay Sheth at Sheth Capital, Inc., bringing an operator’s perspective to the ideas she covers.

Based in Pacific Beach, California, Luna is curious about the people behind the numbers: what they’re building, how they weigh uncertainty, and what makes a risk worth taking. Her articles for Infinite Upside follow those questions through the details, with clear explanations and a feel for how decisions play out in everyday business.

More from Luna Lim

The Infinite Upside store