Flashcards
Transaction Management
Cards in this deck (11)
- 1What is a transaction?A transaction is a collection of actions that make consistent transformations of system states while
preserving system consistency, which is similar to what a query does, except that if the database was
consistent before the execution of the transaction, we can now guarantee that it will be consistent at the
end of its execution regardless of the fact that (1) the transaction may have been executed concurrently
with others (concurrency transparency), and (2) failures may have occurred during its execution (failure
transparency). - 2Explain transaction terminationA transaction always terminates, even when there are failures. If the transaction can complete its task
successfully, we say that the transaction commits. If, on the other hand, a transaction stops without
completing its task, we say that it aborts - 3What are the 4 properties of transaction?(1) atomicity (all or nothing), (2) consistency (no violation of integrity
constraints), (3) isolation (concurrent changes invisible serializable), and (4) durability (committed
updates persist). Together, these are commonly referred to as the ACID properties of transactions. - 4Explain Atomicity.Atomicity refers to the fact that a transaction is treated as a unit of operation. Therefore, either all or
none of the transaction's operations are performed. Atomicity requires that if a transaction is interrupted
by a failure, its partial results must be undone.
Transaction recovery and crash recovery are 2 ways in which atomicity is maintained in case of 2 differernt types of failures. - 5What is consistency property?transaction which executes alone against a
consistent database leaves it in a consistent state, as well as transactions should not violate database
integrity constraints. - 6What are different concurrency scenarios?Database Concurrency: Lost Updates
Database Concurrency: Reading Uncommitted Changes (Dirty Read)
Database Concurrency: Unrepeatable Reads (Fuzzy Read). - 7Explain Database Concurrency: Lost UpdatesLost updates occur when two or more transactions select the same data item and then update the item
based on the value originally selected.
Each transaction is unaware of other transactions. The last update overwrites updates made by the other
transactions, which results in lost data. - 8Explain Database Concurrency: Reading Uncommitted Changes (Dirty Read)t occurs when a second transaction selects a row that is being updated by another transaction. The
second transaction is reading data that has not been committed yet and may be changed by the
transaction updating the row - 9Explain Database Concurrency: Unrepeatable Reads (Fuzzy Read)It occurs when a second transaction accesses the same data item several times and reads different data
each time. It is similar to dirty read in that another transaction is changing the data that a second
transaction is reading.
However, in fuzzy read, the data read by the second transaction was committed by the transaction that
made the change. Also, it involves multiple reads (two or more) of the same row and each time the
information is changed by another transaction. - 10What is Isolation property?Isolation is the property of transactions that requires each transaction to see a consistent database at all
times.
There are two important characteristics. First, serializability, which means that if several transactions are
executed concurrently, the results must be the same as if they were executed serially in same order.
Second, incomplete results, which implies that an executing transaction cannot reveal its results to other
concurrent transactions before its commitment, as well as it is necessary to avoid cascading aborts - 11Explain Durability property.Durability refers to that property of transactions which ensures that once a transaction commits, the
system must guarantee that the results of its operations will never be lost, in spite of subsequent failures.
The durability property brings forth the issue of database recovery, that is, how to recover the database
to a consistent state where all the committed actions are reflected.
Information
- Description
- Distributed Database Flashcards on Transaction Management, created by Varun m on 30/05/2017.
- Created by
- Varun m
- Views
- 0
- Rating