What is Transaction? ACID Properties in DBMS | Explained

infoslearning

The transaction is a set of instructions that performs logical work. As use is concerned Work always happens with an atomic nature (either work execute or not executed). In the database, a transaction is a set of instructions that interact with a database. The transaction should always be atomic and executed in an atomic fashion.

 

It is important to study ACID properties when studying transaction and concurrency control. ACID is important because we want to maintain a consistent database, as we assume a database is consistent and we want to maintain its consistency.

 To maintain the consistency of the database instead of you know working on the database, you must concentrate what are the processes of data which interact with the database, because if the database is already consistency then there is no need to apply any process on the database.

The transaction is the only thing that interacts with a database, so we must concentrate on the transaction instead of the database, because if a transaction works well then our database remains consistent. Therefore, the reason we study ACID properties is if transactions satisfy those ACID properties then the database will maintain its consistency.

A transaction is a logical unit of work on a database. An action or a series of actions that are being performed by a single user or application program, which reads or updates the content of the database.

ACID stands for;

  • Atomicity
  • Consistency
  • Isolation and
  • Durability

 

Atomicity

Atomicity is a basic fundamental / unit of transaction, as we say transactions should always be atomic and execute in an atomic fashion. Atomic means either all instructions participating in transactions must execute or none of them execute.

Question; Which component does the database take care of atomic The transaction management module takes care of atomicity in the database.

Consistency

Consistency means if the database is inconsistent before changes then it should remain inconsistent after the execution of the transaction. Example A + B before transaction must be equal to A + B after the transaction. It is the responsibility of a system programmer which means no other independent module of the system takes care of consistency.

Isolation

In isolation, only one transaction should execute at a time. But if you execute only one transaction at a time means the degree of concurrency will be one, hence a database will be slow. Now “Isolation” means there should be logical isolation. Example transaction (T1) and transaction (T2) in isolation from each other if they are not affected by each other when executed.

Concurrency control management is a module/component which takes care of isolation.

Durability

Durability is if you have makes some changes to the database and you have updated the database into a new stat, then that changes must precise in the system irrespective of any hardware or software failure. For example, if you update 4 to 5, then 5 must be precise in the system whatever the hardware failure.

 

Therefore, in conclusion, if the transaction satisfies ACID properties without any problem you can run that transaction into a database and it will maintain the consistency of the system.


Other Recommended for you

  • .What is Cloud Firestore? Android Studio
  • .Firebase Realtime Database vs Firestore.
  • .What is an Intent in Android? Types of Intent
  • .What is Firebase?