Skip to main content

What does atomicity mean?

Atomicity is a transaction property meaning that every operation inside it runs as a single whole: either all of them succeed, or none of them get saved. You can never end up with "half a result".

What this guarantees

  • no partial changes, if a transaction breaks off halfway through, the system rolls back the steps already taken
  • no "dirty" state, the data stays exactly as it was before the transaction started
  • the outcome is always binary: success (commit) or cancellation (rollback)

A everyday-level example

Imagine transferring money:

  1. debit 100₴ from one account
  2. credit 100₴ to another account

Without atomicity you could end up in an absurd situation, the money got debited but never arrived. With atomicity, both steps run as a single operation: if one fails, the other gets undone too.

The short definition

Atomicity = "all or nothing" within a single transaction.

This protects the system from partial, unfinished, data-damaging changes.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.