ACID Properties | Database Management System (DBMS) - Computer Science Engineering (CSE) PDF Download

ACID Properties in DBMS

A transaction is a single logical unit of work which accesses and possibly modifies the contents of a database. Transactions access data using read and write operations.
In order to maintain consistency in a database, before and after the transaction, certain properties are followed. These are called ACID properties. 

ACID Properties | Database Management System (DBMS) - Computer Science Engineering (CSE)

1. Atomicity 
By this, we mean that either the entire transaction takes place at once or doesn’t happen at all. There is no midway i.e. transactions do not occur partially. Each transaction is considered as one unit and either runs to completion or is not executed at all. It involves the following two operations. 

  • Abort: If a transaction aborts, changes made to database are not visible. 
  • Commit: If a transaction commits, changes made are visible. 

Atomicity is also known as the ‘All or nothing rule’.
Consider the following transaction T consisting of T1 and T2: Transfer of 100 from account X to account Y. 

ACID Properties | Database Management System (DBMS) - Computer Science Engineering (CSE)

 If the transaction fails after completion of T1 but before completion of T2.( say, after write(X) but before write(Y)), then amount has been deducted from X but not added to Y. This results in an inconsistent database state. Therefore, the transaction must be executed in entirety in order to ensure correctness of database state.
2. Consistency 
This means that integrity constraints must be maintained so that the database is consistent before and after the transaction. It refers to the correctness of a database. Referring to the example above,
The total amount before and after the transaction must be maintained.
Total before T occurs = 500 + 200 = 700.
Total after T occurs = 400 + 300 = 700.
Therefore, database is consistent. Inconsistency occurs in case T1 completes but T2 fails. As a result T is incomplete.
3. Isolation
This property ensures that multiple transactions can occur concurrently without leading to the inconsistency of database state. Transactions occur independently without interference. Changes occurring in a particular transaction will not be visible to any other transaction until that particular change in that transaction is written to memory or has been committed. This property ensures that the execution of transactions concurrently will result in a state that is equivalent to a state achieved these were executed serially in some order.
Let X= 500, Y = 500.
Consider two transactions T and T”. 

ACID Properties | Database Management System (DBMS) - Computer Science Engineering (CSE)

Suppose T has been executed till Read (Y) and then T’ starts. As a result , interleaving of operations takes place due to which T’’ reads correct value of X but incorrect value of Y and sum computed by
T’’: (X+Y = 50, 000 + 500 = 50, 500) 
is thus not consistent with the sum at end of transaction:
T: (X + Y = 50, 000 + 450 = 50, 450). 
This results in database inconsistency, due to a loss of 50 units. Hence, transactions must take place in isolation and changes should be visible only after they have been made to the main memory.
4. Durability: 
This property ensures that once the transaction has completed execution, the updates and modifications to the database are stored in and written to disk and they persist even if a system failure occurs. These updates now become permanent and are stored in non-volatile memory. The effects of the transaction, thus, are never lost.
The ACID properties, in totality, provide a mechanism to ensure correctness and consistency of a database in a way such that each transaction is a group of operations that acts a single unit, produces consistent results, acts in isolation from other operations and updates that it makes are durably stored. 

The document ACID Properties | Database Management System (DBMS) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Database Management System (DBMS).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
62 videos|66 docs|35 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on ACID Properties - Database Management System (DBMS) - Computer Science Engineering (CSE)

1. What are the ACID properties in DBMS?
Ans. The ACID properties in DBMS stand for Atomicity, Consistency, Isolation, and Durability. These properties ensure the reliability and integrity of a database system. Atomicity guarantees that a transaction is treated as a single, indivisible unit of work. Consistency ensures that the database remains in a valid state before and after a transaction. Isolation ensures that concurrent transactions do not interfere with each other. Durability guarantees that once a transaction is committed, its changes are permanent and will survive any subsequent failures.
2. How does Atomicity property ensure data integrity in DBMS?
Ans. Atomicity property in DBMS ensures data integrity by treating a transaction as a single, indivisible unit of work. Either all the actions performed within a transaction are committed, or none of them are. This means that if any part of a transaction fails, all the changes made by that transaction are rolled back, and the database remains unchanged. Thus, atomicity ensures that the database remains in a consistent state, preventing partial updates or inconsistent data.
3. What is the significance of the Consistency property in DBMS?
Ans. The Consistency property in DBMS ensures that the database remains in a valid state before and after a transaction. It guarantees that only valid and authorized changes are made to the database. If a transaction violates any integrity constraints or rules defined by the database schema, the Consistency property ensures that the transaction is rolled back, and the database is not left in an inconsistent state. This property helps maintain the accuracy and reliability of the database.
4. How does the Isolation property in DBMS handle concurrent transactions?
Ans. The Isolation property in DBMS ensures that concurrent transactions do not interfere with each other. It provides a level of isolation between transactions, preventing them from seeing each other's intermediate states. Isolation is achieved through various techniques like locking, multi-version concurrency control, and optimistic concurrency control. These techniques ensure that each transaction executes as if it is the only transaction running, avoiding conflicts and maintaining data consistency and correctness.
5. What is the role of the Durability property in DBMS?
Ans. The Durability property in DBMS ensures that once a transaction is committed, its changes are permanent and will survive any subsequent failures. It guarantees that the changes made by a committed transaction are stored in a non-volatile memory, such as a hard disk, and will not be lost even in the event of a power outage or system crash. Durability ensures the reliability and persistence of data, making it highly resistant to data loss or corruption.
62 videos|66 docs|35 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

ACID Properties | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

Extra Questions

,

Viva Questions

,

shortcuts and tricks

,

Important questions

,

Sample Paper

,

Previous Year Questions with Solutions

,

Free

,

Summary

,

MCQs

,

practice quizzes

,

Objective type Questions

,

past year papers

,

pdf

,

ACID Properties | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

Semester Notes

,

ACID Properties | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

ppt

,

study material

,

video lectures

,

mock tests for examination

,

Exam

;