ACID – an acronym referring to Atomicity, Consistency, Isolation and Durabilityas applied to database transactions. ACID transactions guarantee that each read, write, or modification of a database table has the following properties:
- Atomicity – each read, write, update or delete statement in a transaction is treated as a single unit and either the entire statement is executed, or none of it is. This prevents data loss and corruption from occurring if a transaction fails midway,
- Consistency – transactions only make changes to tables in predefined, predictable ways so that data corruption or errors don’t create unintended consequences for the integrity of your table.
- Isolation – when multiple users are reading and writing from the same table all at once, isolation of their transactions ensures that the concurrent transactions don’t interfere with or affect one another. Each request can occur as though they were occurring one by one, even though they’re actually occurring simultaneously.
- Durability – ensures that changes to your data made by successfully executed transactions will be saved, even in the event of system failure.
In summary, an ACID-compliant database transaction is any operation that is treated as a single unit of work, which either completes fully or does not complete at all, and leaves the storage system in a consistent state. ACID properties ensure that a set of database operations (grouped together in a transaction) leave the database in a valid state even in the event of unexpected errors. A common example of a single transaction is the withdrawal of money from an ATM. Find out more here.