Skip to content

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.

  1. The Kyoto itinerary is at version 3. You must know the version before you can lock on it.

  2. 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.

  3. 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

ItinerariesDynamoDB workbench
Ready to run
Explore an access patternSelect to load & run

The Kyoto itinerary is at version 3. You must know the version before you can lock on it.

Request
Execute against the local Dynoxide engine
ReturnedFiltered outChanged
pk(pk)
sk(sk)
title
days
version
DOC#kyoto
vS
Kyoto autumnS
6N
3N
DOC#patagonia
vS
Patagonia trekS
11N
7N
DOC#lisbon
vS
Lisbon weekendS
3N
1N
DOC#nile
vS
Nile cruiseS
8N
2N
DOC#iceland
vS
Iceland ring roadS
9N
5N
Awaiting request
Your next query starts here.

Choose an access pattern above, or build your own request. See what comes back and what it costs.

Powered by DynoxideWASMStarts on your first run · Runs locally in your browser