Atomicity


Last Updated on Feb 09, 2021

Atomicity is one of the four safety guarantees (ACID) that databases provide to avoid specific error scenarios and concurrency issues.

Atomicity can mean similar but subtly different things in different branches of computing. In general, atomic refers to something indivisible, which cannot be broken down into smaller parts.

In the context of a multi-threaded application, atomic operations mean that one thread cannot see the half-finished result of another. The entire process is binary - the system seems to switch from one state to another without any visible transition.

In contrast, ACID atomicity is not about concurrency. The description of what happens when multiple processes try to write or read data at the same time is defined by the I of ACID - Isolation - and not Atomicity.

ACID Atomicity describes what happens when faults occur when an application tries to make several writes at once. It guarantees that either all writes will go through and get persisted in the database, or none will. The ability to abort a transaction on an error and have all writes from that transaction discarded is the defining feature of ACID atomicity.


© 2022 Ambitious Systems. All Rights Reserved.