Transactions

i7752068
Mind Map by , created over 5 years ago

Revision mind map for transaction processing.

29
0
0
i7752068
Created by i7752068 over 5 years ago
SMART School Year Goals
Alice ExamTime
GCSE AQA Biology 1 Variation, Genetics & Reproduction
Lilac Potato
CCNA Security 210-260 IINS - Exam 1
Mike M
Základy práva - 1. část
Nikola Truong
Základy práva - 4. část
Nikola Truong
Data Warehousing and Mining
i7752068
Marketing Research and Support Systems
Kathleen Keller
Probability
tgranville
Untitled
tgranville
Basic Spanish Vocabulary
Alice ExamTime
Transactions
1 ACID Properties
1.1 Atomicity
1.1.1 The transaction is performed in its entirety or not at all.
1.2 Consistency
1.2.1 A transaction must transform the database from one consistent state to another.
1.2.2 A successfully completed transaction is committed by the DBMS.
1.2.3 If the transaction is not completed in its entirety, it is aborted.
1.2.4 Aborted transactions are rolled back to ensure consistency.
1.3 Isolation
1.3.1 Transactions should be isolated from other transactions occurring at the same time.
1.3.2 Hence the need for concurrency control.
1.4 Durability
1.4.1 Once a transaction is completed (committed), its effects are permanently recorded in the database.
1.4.2 These effects must not be lost because of subsequent failures.
2 Transaction Management
2.1 Database Recovery
2.1.1 The process of restoring the database to a correct state should a failure occur in the middle of a transaction.
2.1.2 Preserves atomicity and durability.
2.2 Concurrency Control
2.2.1 The process of managing simultaneous operations on a multi-user DB without allowing them to interfere with one another.
2.2.2 Preserves consistency and isolation.
3 Types of backup
3.1 Complete copy of whole database.
3.2 Incremental backup (copy of modifications made since the last complete or incremental backup).
3.3 Backups of the logs file.
4 Concurrency Control
4.1 The Scheduler
4.1.1 A DBMS module responsible for implementing a particular strategy for concurrency control.
4.1.2 Allows the CPU to execute several transactions concurrently instead of waiting for the I/O operations of one transaction to complete before another can begin.
4.1.3 Transactions are interleaved.
4.2 The Lost Update Problem
4.2.1 When two transactions accessing the same item have their operations interleaved in a way that makes the value of some database items incorrect.
4.3 The Temporary Update
4.3.1 When one transaction updates a database item and then the transaction fails. Updated item is accessed by another transaction before it is changed back to its original value.
4.4 The Incorrect Summary
4.4.1 Aggregate function may calculate some values before they are updated and others after they are updated.
5 Types of Schedules
5.1 Serial Schedule
5.1.1 Operations of each transaction are executed consecutively.
5.1.2 No interleaved operations from other transactions.
5.1.3 Transactions cannot interfere with each other.
5.2 Non-serial Schedule
5.2.1 Operations from a set of concurrent transactions are interleaved.
5.2.2 Potential for interference between concurrent transactions.
6 Concurrency Control (Locking)
6.1 Locking
6.1.1 Procedure used to control concurrent access to data (items).
6.1.2 When one transaction is accessing a data item, a lock may deny access to other transactions.
6.2 Granularity of locks
6.2.1 Entire database.
6.2.2 A file.
6.2.3 A page.
6.2.4 A record.
6.2.5 A field value of a record.
6.3 Read (shared) locks
6.3.1 If a transaction has a shared lock on a data item, it can read the item but not update it.
6.3.2 Read locks cannot conflict, so more than one transaction can hold shared locks on the same item.
6.4 Write (exclusive) locks
6.4.1 Transaction can read and update item.
6.4.2 Only one transaction at a time can hold this lock on an item.
6.4.3 Other transactions cannot lock, read or update that item.
6.5 Releasing locks.
6.5.1 It explicitly releases lock during execution.
6.5.2 Transaction terminates (commits or aborts).
7 Two-Phase Locking (2PL)
7.1 Transaction follows the two-phase locking protocol if all locking operations precede the first unlock operation.
7.2 Guarantees serializability and is the best known protocol.
7.3 Growing Phase
7.3.1 Transaction must lock every item it operates on.
7.3.2 Transaction acquired all the locks it will need and cannot release any lock.
7.4 Shrinking Phase
7.4.1 Transaction releases its locks.
7.4.2 Once a lock has been released, no new locks can be applied.
8 Resolving Deadlocks
8.1 Impasse that may result when two (or more) transactions are each waiting for locks to be released that are held by each other.
8.2 Timeouts
8.2.1 Transaction that requests a lock will wait for a given time only and then the request times out.
8.2.2 Simple and practical strategy, used by several commercial DBMS's.
8.3 Deadlock Prevention
8.3.1 DBMS looks ahead to determine if a transaction would cause a deadlock.
8.3.2 Wait - Die Strategy
8.3.2.1 O needs a resource held by Y. O waits.
8.3.3 Wound - Wait Strategy
8.3.3.1 O needs a resource held by Y. Y dies.
8.4 Deadlock Detection and Recovery
8.4.1 DBMS allows deadlock to occur but recognises occurrences of deadlock and breaks them.
8.4.2 Deadlock detection handled by construction of wait-for graphs that show transaction dependencies.
8.4.3 Deadlock recovery involves aborting one or more transactions.
8.5 Timestampting
8.5.1 No locks involved, avoids deadlocks.
8.5.2 No waiting, conflicting transactions are rolled back and restarted.
8.5.3 Concurrency control protocol that orders transactions in a way that older transactions get priority in the event of a conflict.

Media attachments