ACID Properties in DBMS - BunksAllowed

BunksAllowed is an effort to facilitate Self Learning process through the provision of quality tutorials.

Community

ACID Properties in DBMS

Share This
DBMS, or database management system, refers to the process of organizing and maintaining data in a way that ensures its integrity and consistency, even when modifications are made to it. The integrity of the data is crucial since any compromise to its accuracy or reliability might result in the entire dataset becoming disrupted and corrupted. Thus, in order to preserve the accuracy and consistency of the data, the database management system defines four properties referred to as the ACID properties. The ACID attributes are specifically designed for transactions that include several processes, highlighting the importance of these properties in such scenarios.

This part will provide an in-depth exploration and comprehension of the ACID properties. We shall explore the meanings and purposes of these qualities. We shall further comprehend the ACID qualities by utilizing specific illustrations.


Atomicity


Atomicity ensures that data is maintained in an atomic state. It signifies that any manipulation of the data must be carried out in its entirety or not at all. Furthermore, it suggests that the operation should not be disrupted or just partially finished. When conducting transactions, it is important to ensure that operations are completed in their entirety rather than partially. If any of the operations are not fully performed, the transaction is aborted.

Occasionally, an ongoing operation may be interrupted by a higher-priority operation. This terminates the ongoing operation and the ongoing operation will be cancelled.

If two users attempt to book the only available seat on a train at the same time in the aforementioned situation, the transaction would be deemed completed. Based on the principle of atomicity, the initial user who successfully hits the booking button will secure the seat and receive a message. However, the second person's transaction will be reversed, and they will be informed that no more seats are currently accessible.

In a more straightforward scenario, if an individual attempts to reserve a ticket, chooses a seat, and proceeds to the payment gateway but experiences a failure caused by problems with the bank server, their selected seat will not be held for them. A comprehensive transaction entails both seat reservation and payment completion. In the event of any step encountering an error, the operation is immediately terminated, and the user is returned to the original state without their seat being reserved.

Atomicity in DBMS is commonly known as the principle of 'all or nothing'.


Consistency


This property ensures the verification of the total number of seats remaining in the train by adding the sum of seats booked by users to the sum of seats left, resulting in the total number of seats in the train. Following each transaction, a verification process is conducted to confirm that no errors or discrepancies have occurred.

Let us examine a scenario in which an individual is attempting to reserve a ticket. They have successfully made a reservation for their ticket, however their money has not been processed owing to banking complications. In this scenario, their transaction is reversed. However, merely performing that action is not enough. The quantity of accessible seats must be revised as well. Alternatively, if the system is not updated, there will be a discrepancy where the seat vacated by the individual is not accounted for. Therefore, the sum of the remaining seats in the train plus the sum of the seats reserved by users would not be equivalent to the entire number of seats in the train if it were not for consistency.


Isolation


Isolation is the condition of being separated. Isolation is a fundamental property in DBMS known as ACID, which ensures that the operations performed in one database do not affect or interfere with the operations in another database. Additionally, isolation allows several transactions to occur concurrently without any interference. Put simply, after the operation on the initial state of the database is complete, the process on the subsequent state of the database shall commence. It suggests that if two activities are performed on separate databases, the value of one database may remain unaffected by the value of the other. In the case of transactions, it is important to preserve consistency when multiple transactions occur simultaneously. Changes made in one transaction will not be visible to other transactions until the alteration is committed to the memory.

Imagine a scenario where two individuals attempt to reserve the same seat at the exact same time. Transactions are sequenced in a serialized manner to ensure the integrity of the data. The initial individual's transaction is successful, resulting in the acquisition of a ticket. The second individual's transaction is unsuccessful due to the seat already being reserved. An error notice is received, indicating that there are no seats available.


Durability


The durability property in DBMS refers to the guarantee that once an operation is properly finished, the database will be permanently stored on the disk. The database's durability should be sufficient to ensure its survival even in the event of system failure or crashes. Nevertheless, in the event of database loss, the recovery manager assumes the responsibility of ensuring the database's enduring sustainability. After each modification, it is necessary to utilize the COMMIT command in order to officially save the alterations.

This is an example. Assume that a system breakdown occurred in the railway management system, leading to the complete loss of all recorded train details. Countless customers who had purchased their tickets are currently unable to access the train, resulting in substantial monetary damages and undermining confidence in the organization. The situation is highly urgent due to the vital necessity of these trains, resulting in widespread worry and discomfort.


Happy Exploring!

No comments:

Post a Comment