Options
Why
"Check, then act" is a race: both servers see no key and both charge. An atomic insert lets the database pick exactly one winner; the loser waits for the winner's result or returns 409 Conflict.
API design · Multiple choice
"Check, then act" is a race: both servers see no key and both charge. An atomic insert lets the database pick exactly one winner; the loser waits for the winner's result or returns 409 Conflict.