Advertisement

Search Topics....

Monday, February 6, 2012

ACID Property : Database Transactions

ACID is a set of properties that guarantee database transactions are processed reliably.

Atomicity
Atomicity requires that database modifications must follow an "all or nothing" rule. Each transaction is said to be atomic. If one part of the transaction fails, the entire transaction fails and the database state is left unchanged. An atomic system must guarantee atomicity in each and every situation, including power failures, errors, and crashes. This guarantees that a transaction cannot be left in an incomplete state.

Consistency
The consistency property ensures that any transaction will bring the database from one valid state to another. Any data written to the database must be valid according to all defined rules, including but not limited to constraints, cascades, triggers, and any combination thereof.

Isolation
Isolation refers to the requirement that no transaction should be able to interfere with another transaction. No transactions that affect the same rows can run concurrently, since their sequence, and hence the outcome, would be unpredictable. This property of ACID is often partly relaxed due to the huge speed decrease this type of concurrency management entails.

Durability
Durability means that once a transaction has been committed, it will remain so, even in the event of power loss, crashes, or errors. In a relational database, for instance, once a group of SQL statements execute, the results need to be stored permanently. If the database crashes immediately thereafter, it should be possible to restore the database to the state after the last transaction committed.

No comments: