/əˈtɑː.mɪ.sɪ.ti/
noun — "all-or-nothing execution in operations."
Atomicity is a property of operations in computing and database systems that ensures a sequence of actions within a transaction are treated as a single, indivisible unit. Either all actions in the transaction complete successfully, or none are applied, leaving the system in a consistent state. Atomicity prevents partial updates that could lead to data corruption, inconsistencies, or unpredictable behavior.
Technically, atomicity is one of the four ACID properties (Atomicity, Consistency, Isolation, Durability) used to define reliable transactions in database management systems. Implementations often rely on mechanisms such as write-ahead logging, transaction journals, or hardware support like CPU instructions for atomic operations. Low-level atomic operations, such as compare-and-swap or test-and-set, are used in concurrent programming to ensure thread-safe manipulation of shared data without intermediate states visible to other threads.
Atomic operations are critical in multi-threaded or distributed environments. For example, when transferring funds between two bank accounts, a transaction debits one account and credits another. Atomicity ensures that either both operations occur, or neither does, even in the presence of failures like system crashes or network interruptions.
In workflow terms, atomicity can be applied to database updates, file system operations, or message processing in pub/sub systems. Developers rely on atomic operations to guarantee consistency when multiple processes interact with shared resources simultaneously.
Conceptually, atomicity acts like a sealed envelope: a transaction either fully delivers its contents or is never opened, leaving the system state unaltered if any part fails.
See ACID, Transaction, Concurrency.