accesspatterns.dev

Claim it, or fail

A ConditionExpression lets a write happen only if the data still allows it.

Why

A PutItem normally overwrites whatever shares its key. A ConditionExpression guards it: the write happens only if the condition holds at the instant it runs, atomically, with no read-first race for two callers to lose.

Claim a free callsign and attribute_not_exists(pk) passes. Claim one alice already holds and the engine rejects the write with a ConditionalCheckFailedException, leaving her record untouched. Read it back to confirm. This is how you register something exactly once.

A condition turns a blind write into a guarded one. attribute_not_exists is a first-writer-wins claim, enforced at write time.

Callsigns

These rows are real and already here. Running an operation against them downloads a DynamoDB-compatible engine, about 850 KB, and executes it in this tab.

Try an example

attribute_not_exists(pk) means 'only if nobody holds this'. The callsign is free, so the write lands.

pk(pk)
owner
claimedAt
HANDLE#m0abc
aliceS
2026-01-04S
HANDLE#g4xyz
rajS
2026-02-11S
HANDLE#k2def
meiS
2026-03-02S
HANDLE#vk3ghi
tomS
2026-03-19S
HANDLE#ja1jkl
yukiS
2026-04-08S
HANDLE#ea5mno
sofiaS
2026-05-21S

Run an operation to see the raw engine response.

table Callsignskeys pkitems 6