An agent checkpoints workflow state in Amazon DynamoDB so another worker can resume after a failure. Two workers can load the same checkpoint concurrently; how should updates prevent one worker from silently overwriting the other's progress?
Show the answer
Correct answerB. Condition each write on the stored version matching the version previously read.
AWhy not this: Last-arriving writes can replace newer workflow progress with state derived from an older checkpoint.
BWhy this is right: A version condition rejects stale updates, preventing silent overwrites of concurrent progress.
CWhy not this: Worker-local memory is neither shared concurrency control nor a durable checkpoint during execution.
DWhy not this: A consistent read does not make the subsequent write atomic with that read; another worker can update the item between them.
Version-conditional writes implement optimistic locking: a stale worker's update fails and must be reconciled with current state. Strongly consistent reads alone do not prevent another worker from updating the checkpoint between a read and a write.