Subject: Introductory Database
Transactions are groups of activities that collectively constitute a single logical unit of work. A database system must guarantee effective transaction execution despite errors. It must manage concurrent execution of transactions in a way that avoids the introduction of inconsistency. This would lead to an inaccurate outcome. Atomicity, Consistency, Isolation and Durability of a transaction must be maintained so that there is no transactional error.
From the perspective of the database user, a collection of multiple database activities frequently appears to be a single unit. For instance, transferring money from a checking account to a savings account is seen by the consumer as a single operation; nevertheless, the database system sees it as multiple activities. It is obvious that all of these activities must take place, or none at all, in the event of a failure. If the savings account was not credited but the checking account was debited, it would not be acceptable.
Transactions are groups of activities that collectively constitute a single logical unit of work. Either the full transaction executes, or none of it does, hence a database system must guarantee effective transaction execution despite errors. In our funds transfer example, a transaction computing the customer's total money might see the checking account balance before it is debited by the funds transfer transaction, but see the savings balance after it is credited. As such, it must manage concurrent execution of transactions in a way that avoids the introduction of inconsistency. This would lead to an inaccurate outcome.
A transaction is a segment of program execution that accesses and may update different pieces of data. A transaction is typically started by a user program written in a high-level data manipulation language. This user program uses statements of the type begin transaction and end transaction to define its boundaries. We need that the database system uphold the following characteristics of the transactions in order to guarantee the data's integrity:
These characteristics are known as ACID properties, an acronym created from the initial letters of the four characteristics mentioned above. Despite the fact that the database is permanently stored on disk, some of it is also temporarily present in main memory.
Transactions use two operations to access data:
A write operation does not always result in an immediate update of the data on the disk in a real database system. The write operation could be conducted on the disk later after being temporarily saved in memory. Assume that writing is currently finished right away.
Let Tx represent a transfer of Rs. 4000 from account A to account B. This money transfer request is performed as below:
Tx:
read(A);
A:=A-4000;
Write(A);
Read(B);
B:=B+4000;
Write(B);
Let's think about each ACID criteria that applies to this transaction.
The database system's "recovery management component" is in charge of making sure about the durability.
© 2021 Saralmind. All Rights Reserved.