ACID(Atomicity Consistency Isolation Durability) is a set of properties that guarantee that database transactions are processed reliably.
In the context of databases, a single logical operation on the data is called a transaction.
Atomicity is an all-or-none proposition.
Modifications on the data in the database either fail or succeed. Each transaction is said to be “atomic.” If one part of the transaction fails, the entire transaction fails. It is critical that the database management system maintain the atomic nature of transactions in spite of any DBMS, operating system or hardware failure.
Consistency guarantees that a transaction never leaves your database in a half-finished state.
Only valid data (valid according to integrity constraints) may be committed. 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.
Isolation keeps transactions separated from each other until they’re finished.
One transaction does not interfere with another. The ‘executor’ of a transaction has the feeling that he has the entire database for himself.
A committed transaction will not be lost.
Durability means that once a transaction has been committed, it will remain so, even in the event of power loss, crashes, or errors, i.e. the database will keep track of pending changes in such a way that the server can recover from an abnormal termination.
Example of printer to understand the ACID property more clearly.
Either the entire document gets printed or nothing at all.
At end-of-transaction, the paper feed is positioned at top-of-page.
No two documents get mixed up while printing.
The printer can guarantee that it was not “printing” with empty cartridges
ACID properties provide the basic building blocks of any database transaction model. So spend few minutes to review these characteristics and commit these in your memory 🙂