Ravi Sir's Cards › AWS
Why ADD clicks instead of read-modify-write?
This interview card answers: Why ADD clicks instead of read-modify-write? Two redirects at once can both read clicks=5 and both write 6 — one click lost. UpdateItem ADD is atomic on the server for that attribute. UpdateExpression SET … ADD clicks :one with :one = 1 on every redirect.
Read card text
What this card says
What it is
Two redirects at once can both read clicks=5 and both write 6 — one click lost.
Why it matters
UpdateItem ADD is atomic on the server for that attribute.
How / example
UpdateExpression SET … ADD clicks :one with :one = 1 on every redirect.