atomicity

The property that a group of changes happens completely or not at all, with no half-finished state ever visible.

In more detail

A transfer between accounts that is atomic either debits and credits both sides or changes nothing. Databases, file systems and many APIs offer atomic operations so that a failure part-way through cannot leave data inconsistent.

Examples

In the browser: appending a DocumentFragment inserts all its nodes in one step, and IndexedDB transactions roll back every change if any request fails.
The transfer demo restores the original balance when the second half of the transfer fails.

Related terms

Taught in

References