DBMS Notes – ACID Properties and Transaction

Most Commented Posts

A transaction is an activity or sequence of operations carried out by a single user or application software to read or update the database’s contents. 

On the other hand, The ACID qualities of a transaction give a method of maintaining database consistency in a way that each transaction is a single set of activities that produces consistent results and functions in isolation from other transactions. It provides durability- thus making a database resistant to system failures. 

Transaction in DBMS 

On the database, a transaction can be defined as a logical unit of work. It may be a full programme, a section of a programme, or a single command (like SQL commands like INSERT or UPDATE), and it could do any number of database operations. The execution of an application programme in a database can be thought of as one or more transactions, with non-database operations in between. 

DBMS transaction states 

There are several states to go through during the life of a transaction. These states inform the operating system of the transaction’s current state and instruct the user on how to proceed with the transaction’s processing. These states provide the regulations that determine whether a transaction will commit or abort. 

The different types of transaction states are as follows. 

Active state- The transaction is considered to be in an active state while the operations of the transaction are running. 

Partially committed- After all read and write operations, the changes made in the main memory are now permanently committed to the database. 

Failed state- The transaction enters the failed state whenever any operation fails during the transaction. 

Aborted state- If a transaction fails during execution, it moves from the failed state to the aborted state. Uncommitted modifications are either rolled back or erased. 

Terminated state- If a transaction completes all operations, all changes to the partially committed state are permanently stored, and the transaction is declared complete. 

Terminated state- If a transaction is aborted after a rollback or the transaction returns to the committed state, the database returns to a consistent state and is ready for future transactions because the prior transaction is now ended. 

A transaction’s lifetime contains numerous states; these states inform the system about the transaction’s current state and also inform the user about how to prepare for future processing. To learn more about transaction in DBMS, click here. 

What are ACID Properties in DBMS? 

A database management system (DBMS) is a system for managing data that must remain integrated when changes are made to it. Because when the data’s integrity is compromised, the entire data set will be disrupted and ruined. As a result, the ACID properties, which are four properties stated in the database management system, are used to maintain data integrity. The ACID qualities are intended for transactions that go through a series of tasks, and it is here that the role of the ACID characteristics is shown. 

Properties of ACID

The name ACID, when expanded, stands for:

1) Atomicity- This refers to the fact that the data is atomic. It means that if any operation on the data is conducted, it should either be performed or executed completely, or it should not be performed at all. 

2) Consistency- Consistency indicates that the value should be retained at all times. The integrity of the data should be maintained in DBMS, which means that whenever a modification is made to the database, it should always be preserved. 

3) Isolation- The term “isolation” refers to the act of being separated from others. Isolation in DBMS refers to the property of a database where no data from one database should impact the other and where many transactions can take place at the same time. 

4) Longevity- Longevity refers to something’s ability to last. The term durability in DBMS refers to the fact that if an operation is completed successfully, the data remains permanent in the database. 

As a result, the ACID attribute of DBMS is critical for ensuring data consistency and availability in the database. To learn more on ACID properties in DBMS, click here.

Most Commented Posts

Related Posts