atomic operation
An operation that happens completely or not at all, with no other operation able to see or act in between.
In more detail
Check then create must be one atomic step, such as an insert guarded by a unique constraint, or two workers can both proceed. Databases provide atomicity through transactions, unique constraints and conditional writes.
Related terms
- check then act — Reading whether something exists and then acting on the answer as two separate steps, which races under concurrency.
- transaction — A group of database changes that succeed or fail together, so the data is never left half-updated.
- conditional write — A write that only succeeds if the current value still matches a stated condition, such as the key being absent.
Taught in
- The Storage Decision: Relational Versus Document — Scalable System Design & Distributed Architecture
- Idempotency, And Exactly Once As A Fiction — Scalable System Design & Distributed Architecture