ACID - Transaction Properties

ACID - Transaction Properties
which stands for “atomicity, consistency, isolation, durability.”

These four words form a set of properties that
database systems should implement to guarantee reliability of data storage, processing, and manipulation.

• Atomicity: All data changes should be transactional in nature. That is, data changes should follow an
all-or-nothing pattern. The classic example is a double-entry bookkeeping system in which every debit has an associated credit. Recording a debit-and-credit double-entry in the database is considered one “transaction,” or a single unit of work. You cannot record a debit without recording its associated credit, and vice versa. Atomicity ensures that either the entire transaction is performed or none of it is.

• Consistency: Only data that is consistent with the rules set up in the database will be stored. Data types and constraints can help enforce consistency within the database. For instance, you cannot insert the name Dolly in an int column. Consistency also applies when dealing with data updates. If two users update the same row of a table at the same time, an inconsistency could occur if one update is only partially complete when the second update begins. The concept of isolation, described following,is designed to deal with this situation.

• Isolation: Multiple simultaneous updates to the same data should not interfere with one another. SQL Server includes several locking mechanisms and isolation levels to ensure that two users cannot modify the exact same data at the exact same time, which could put the data in an inconsistent state.
Isolation also prevents you from even reading uncommitted data by default.

• Durability: Data that passes all the previous tests is committed to the database. The concept of durability ensures that committed data is not lost. The transaction log and data backup and recovery features help to ensure durability.
The transaction log is one of the main tools SQL Server uses to enforce the ACID concept when storing and manipulating data.

Click here to get SQL Server 2008 Ebook from Microsoft

No comments: