Most Important Topic For Interview Perspective is ACID properties in DBMS.

Before Going to ACID Properties We First Understand about Transaction. Everybody Knows about Transaction Whenever We hear that Word Transaction What was the First Thought Comes Our mind is all about the bank Right or We can say that Transaction is related to Money.



So, What is Transaction??

In Technical Words "A Transaction is a set of Changes that must all be made Together". It is
a Program Unit Whose Execution may or may not change the contents of  a database.


Let's Jump to the Point...

1.Atomicity

Suppose, you are transferring money from your bank account to your friend’s bank account. This transaction to transfer funds from one account to another involves making a withdrawal operation from the first account and a deposit operation on the second. If the deposit operation failed, you don’t want the withdrawal operation to happen either. Otherwise that money would disappear!

Lumping both operations into a single atomic transaction ensures data integrity. This is what is called atomicity in DBMS. It is the property that a transaction is a single indivisible transaction. The individual operations within a transaction either all have to be performed or none will be performed. If any single operation fails then the whole transaction fails. This ensures that the databases are in a valid state at all times.

The transaction management unit of a database management system is responsible for maintaining atomicity transactions on a database.


2.Consistency

Ensures that only valid data following all rules and constraints is written in the database. When a transaction results in invalid data, the database reverts to its previous state, which abides by all customary rules and constraints. This must be totally ensured by the programmer.

Suppose A is transferring $100 to B's account. Assume A has initially $300 and B has $500. So
After the transaction A has $200 And B has $600. This basically means sum of balances of both A's and B's account are same before and after transaction.


3.Isolation

Ensures that transactions are securely and independently processed at the same time without interference, but it does not ensure the order of transactions. For example, user A withdraws $100 and user B withdraws $250 from user Z’s account, which has a balance of $1000. Since both A and B draw from Z’s account, one of the users is required to wait until the other user transaction is completed, avoiding inconsistent data. If B is required to wait, then B must wait until A’s transaction is completed, and Z’s account balance changes to $900. Now, B can withdraw $250 from this $900 balance.

The concurrency control unit of a database management system is responsible for maintaining isolation among transactions on a database.


4.Durability

Imagine you have 10 lakh amount in your bank account. The bank database server goes down, all data stored on that server is gone and so your money is gone! So you need durability, a fault free system.

This property ensures that once the transaction has completed execution, the updates and modifications to the database are stored in and written to the disk(of the database server) and they persist permanently even if a system failure occurs.

Organizations, such as banks and hospitals, their very existence depends on the information systems run on databases. The ability to recover 100% of all committed transactions is absolutely crucial. The recovery rate must be 100 percent, not 90 percent or even 99.9 percent. In addition, this recovery must be permanent, meaning all transactions must be reconstructed, even if the database server crashes due to OS failure or power loss.

The recovery management component of the database management system is responsible for maintaining durability in a database.


 I hope that much explain you all๐Ÿ˜‡.


   

Comments

Popular Posts