Week 8 UAS Flashcards
What is Transaction?
Action, or series of actions, carried out by user or application, which reads or updates contents of database.
Can have one of two outcomes:
1. Success - transaction commits and
database reaches a new consistent state.
2. Failure - transaction aborts, and database must be restored to consistent state before it started.
- Such a transaction is rolled back or undone.
Four basic (ACID) properties that define a transaction?
- Atomicity ‘All or nothing’ property.
- Consistency Must transform database from one consistent state to another.
- Isolation Partial effects of incomplete transactions should not be visible to other transactions.
- Durability Effects of a committed transaction are permanent and must not be lost because of later failure.
What is Concurrency Control?
Process of managing simultaneous operations on the database without having them interfere with one another.
3 examples of potential problems caused by concurrency?
- Lost update problem.
- Uncommitted dependency problem.
- Inconsistent analysis problem.
Serializabilty?
Serializability identifies those executions of transactions guaranteed to ensure consistency.
Two basic concurrency control techniques?
- Locking, a procedure used to control concurrent access to data. To deny access to other transaction and so prevent incorrect updates.
- Timestamping, A concurrency control protocol that orders transactions in such a way that older transactions, transactions with smaller timestamps, get priority in the event of conflict.
What is Two-phase locking (2PL)
A transaction follow the two-phase locking protocol if all locking operations precede the first unlock operation in the transaction
What is Deadlock and 3 techniques for handling deadlock?
An impasse that may result when two (or more) transactions are each waiting for locks to be released that are held by the other.
3 general techniques for handling deadlock?
- timeouts
- deadlock prevention
- deadlock detection and recovery
3 phases of Optimistic Techniques?
- Read
- Validation
- Write
Granularity of Data Items - Ranging from coarse to fine
- The entire database
- a file
- a page
- a record
- a field value of a record
DBMS should provide following facilities to assist with recovery:
- Backup mechanism, which makes periodic backup copies of database.
- Logging facilities, which keep track of current state of transactions and database changes.
- Checkpoint facility, which enables updates to database in progress to be made permanent.
- Recovery manager, which allows DBMS to restore database to consistent state following a failure.
What is checkpoint?
the point of synchronization between database and log file. All buffers are force-written to secondary storage.
3 main recovery techniques?
- Deferred update, updates are not written to the database until after a transaction has reached its commit point.
- immediate update, updates are applied to the database as they occur without waiting to reach the commit point.
- shadow paging, maintains two-page tables during the life of a transaction: a current page table and a shadow page table.
Look at five advanced transaction models:
- Nested Transaction Model
- Sagas
- Multi-level Transaction Model
- Dynamic Restructuring, main advantages:
a. Adaptive recovery.
b. Reducing isolation. - Workflow Models