Skip to content

What is atomicity?

GeneralClass 12AllAnswered 27 Mar 2026
Answer

Atomicity, in the context of databases and transactions, refers to one of the ACID properties, which are a set of characteristics ensuring the reliability of database transactions. ACID stands for Atomicity, Consistency, Isolation, and Durability.

Atomicity specifically addresses the concept of making a database transaction indivisible or all-or-nothing. A transaction is considered atomic if it is treated as a single, indivisible unit of work. This means that either all the operations within the transaction are successfully completed, and the changes are committed to the database, or none of the operations are performed, and the database remains unchanged.

In practical terms, atomicity prevents transactions from being left in an intermediate or inconsistent state. If any part of the transaction fails (encounters an error or any other issue), the entire transaction is rolled back, and any changes made to the database during the course of the transaction are undone. This ensures data integrity and consistency, even in the presence of errors or failures.

For example, consider a money transfer transaction from one bank account to another. Atomicity ensures that either the entire transaction, including debiting the money from one account and crediting it to another, is completed successfully, or none of it happens. If there is an issue at any stage (e.g., insufficient funds), the entire transaction is rolled back to maintain the consistency of the database.

General · Class 12