Software engineering · Operations & workflows

Atomic.

An operation completes as a whole or leaves none of its partial changes behind.

Useful when several changes must succeed together.

“Make creating the invoice and its line items atomic; a failure must leave neither behind.”

A closer look

A transaction can group several writes into one unit. If one write fails, the whole unit rolls back. Be explicit about the boundary: a database transaction does not automatically include an email already sent through an external service.

Put it to work

“Transfer the balance and record the ledger entry in one atomic transaction.”

A useful distinction

Atomicity is an all-or-nothing property. It does not by itself guarantee isolation from concurrent operations or safe repetition.

Further reading

Transactions · PostgreSQL documentation
Revision 1 · EN