Skip to main content
CloudCertPrep
DVA-C02Domain 1: Development with AWS ServicesServerless & APIsmediumSingle choice

An app must update an item ONLY if it hasn't been modified by another process since it was read — classic optimistic concurrency. Which DynamoDB feature enforces this?

A.TransactWriteItems wrapping every write

Transactions are for multi-item atomicity — overkill for single-item checks.

B.A ConditionExpression checking a version attribute (e.g., version = :expected)

Correct. Conditional writes = optimistic locking.

C.Strongly consistent reads

Consistent reads guarantee fresh reads, not safe writes.

D.DynamoDB Streams

Streams react to changes; they don't prevent them.

Why this answer

ConditionExpression is DynamoDB's optimistic-locking primitive: the write fails with ConditionalCheckFailedException unless the condition holds — the standard pattern is a version number checked-then-incremented. Transactions work but are heavier and cost 2× writes.

Correct answer: B · Last reviewed 2026-11-03

Official AWS references

Practice this interactively

Answer without seeing the solution first in the Serverless & APIs practice session.

Practice Serverless & APIs