No silent clobbers
A version check lets an update land only if nobody changed the item since you read it.
Why
Two people open the same itinerary. Without a guard, the second to save silently overwrites the first. A version attribute fixes that: every write carries the version it expects and bumps it atomically with ADD.
Update with the version you read and it lands, taking version from 3 to 4. Run the stale update and the condition version = 3 no longer holds, so the engine rejects it with a ConditionalCheckFailedException. The stale writer must re-read and retry. No update is ever lost.
A version attribute plus a condition gives optimistic concurrency: a stale write bounces instead of silently overwriting a newer one.
Try it. Then change it.
Predict what each request will do. Run it, inspect the response, then change a value in the workbench and try again.
The Kyoto itinerary is at version 3. You must know the version before you can lock on it.
SET the change and ADD one to version, but only if version is still 3. It is, so the write lands and version becomes 4.
Run the same update again. Version is 4 now, so the condition version = 3 fails: a writer who still thinks it is 3 is rejected.
Built on this
- Change & Audit Log - What happened, and when?
The Kyoto itinerary is at version 3. You must know the version before you can lock on it.
Choose an access pattern above, or build your own request. See what comes back and what it costs.