ACID

What is ACID in database terms?

The ACID model (Atomicity, Consistency, Isolation, Durability) is a set of properties that guarantee database transactions. These transactions all happen at the same time. It is one of the oldest and most important concepts of database theory.

It sets forward four goals that every database management system must strive to achieve: atomicity, consistency, isolation and durability. No database that fails to meet any of these four goals can be considered reliable.

It requires that database modifications must follow an "All or Nothing" rule. If one transaction fails, all the transactions will fail. To be compliant with the 'A', a system must guarantee the atomicity in each and every situation, including power failures / errors / crashes. This guarantees that 'an incomplete transaction' cannot exist.
 * Atomicity**

Only valid data will be written to the database. If, for some reason, a transaction is executed that violates the database’s consistency rules, the entire transaction will be rolled back and the database will be restored to a state consistent with those rules. On the other hand, if a transaction successfully executes, it will take the database from one state that is consistent with the rules to another state that is also consistent with the rules.
 * Consistency**

Refers to the requirement that no transaction should be able to interfere with another transaction at all. In other words, it should not be possible that two transactions affect the same rows run concurrently, as the outcome would be unpredicted and the system thus made unreliable.
 * Isolation**

Means that any transaction committed to the database will not be lost. Through the use of database backups and transaction logs that facilitate the restoration of committed transactions in spite of any subsequent software or hardware failures.
 * Durability**