ACID

To understand a transaction in a database you can think of a single unit of database-processing like updating, deleting, …

You can start and complete a transaction. If there is a problem is between you can go for a rollback and everything is like the state of the beginning. The ACID-properties are properties of such an transaction. ACID is:

A = atomicity
Atmoicity tells that a transaction is there or is not. You just can go for the whole transaction or everthing will turn back to the start of the transaction via a rollback. So we just can have all operation or none. This is maintained by the transaction management component.

C = consistency
Consistency means nothing else than correctness. The best example for this is a financial transaction form account A to account B. For this we have to decrease the balance of account A by the value X. Than we add the value of X to the balance of account B. Consistency now says that there is no opportunity to run into an error and having the decrease account A without a increased account B. The responsibility to have consistency has to be assumed by the programmer.

BTW: In new databases like facebook uses for example, the database-consistency is compromised to run faster queries.

I = isolation
Isolation means that if there are two transactions (1 and 2) parallel completed that this should be the same result as if you run first transaction 1 and than transaction two and the other way around. So every transaction should not be affected by another transaction. This tasks is done by the concurrency control management.

D = durability
This property says that transactions and their changes must not be lost due some database failure. So whatever will happend the database will not loose some changes. The responsibility for this is in the recovery management.

Advertisements