ACID is an abbreviation in computer science. It describes frequently desired properties of transactions in database management systems (DBMS) and distributed systems. It stands for atomicity, consistency, isolation and durability. They are considered a prerequisite for the reliability of systems. The acronym ACID for characterizing transactions was coined in 1983.
A transaction is a sequence of database operations that are either performed at all or not (all-or-nothing property). In practice, the individual database statements that make up the transaction are, of course, executed sequentially, but globally “declared valid and enacted” only when they are completed. However, if it turns out during the transaction that it cannot be completed completely, the original range is declared valid and rolled back, i.e. all previously executed statements are undone if necessary —or simply the memory area used for the changes in the meantime is released and the validity is left in place.
Consistency means that a transaction leaves a consistent database state after it is completed if the database was consistent before that. This means that all health conditions defined in the database schema are checked before the transaction is completed. If this is not possible, or if an error occurs, the entire transaction is undone.
The principle of isolation prevents/restricts incidental transactions in progress. This is usually done by locking procedures that block the required data for other transactions before accessing data. Blocking procedures restrict concurrency and can lead to blockages. In many database systems, therefore, the isolation method used can be configured to allow certain undesirable effects to achieve a higher concurrency. The transactional isolation level defines the permitted type of influence, common settings are included, as well.
The term persistence indicates that data is guaranteed to be permanently stored in the database after a transaction is completed. The permanent storage of the data must also be guaranteed after a system failure (software failure or hardware failure). In particular, data loss must not occur after the main memory failure. Durability can be ensured by writing a transaction log. A transaction log allows you to perform all missing write operations in the database after a system failure.
Issues and Limitations of ACID
In distributed databases, problems arise when all ACID properties are to be met and at the same time, high availability is to be achieved. These problems were formulated in Brewer’s CAP theorem. In the environment of the NoSQL databases, therefore, the BASE principle (Basically Available, Soften state, Eventual consistency) is often followed.