Wednesday, April 2, 2008

ACID Property

Introduction

Reliabilty is a property that each database management system thrives to achieve. Certain characteristics of such a database are Atomicity, Consistency, Isolation, Durability in short ACID. These properties ensure that all the database transactions are reliably processed.

A transaction for that matter might consist of a number of atomic operatations, the completion of which make the transaction successful. Lets peek into all these characteristics which aim to make a db transaction reliable.

Atomicity - This property suggests that the DBMS should guarantee that either all or none of the actions of a transaction are performed. i.e. it either commits the entire transaction or rollbacks any actions performed from the beginning of the transaction in case of a failure.

Consistency This property ensures that the database remains in consistent state before and after the transaction (inspite of it being successful or not)

Isolation Ability to make operations in a transaction isolated from the other operations, thus making the transaction history serializable.

Durability Refers to the guarantee that once the user has been notified of success, the transaction will persist, and not be undone. This means it will survive system failure, i.e. a transaction is deemed comitted after it is safely in the log which is used to recreate the system state before the failure.

Techniques to implement ACID

There are two techniques to implement ACID.

Write ahead logging - Logs transaction actions and writes to the database only on commit.

Shadow Paging - Updates are applied to the copy of the database and the new copy is activated when transaction commits.

Both these techniques require aquiring locks. Alternative to locking is multiversion concurrency control.

What people said... (0)