Schedule and its types
Schedule: it refers to the sequence in which the set of concurrent/multiple transactions is executed.
- It is the sequence in which the operations (such as read, write, commit, abort) of multiple transcation executed
- so it helps in data consistency and integrity
so for example, if we have T1, T2, T3 .... TN transcations then the possible schedule = n!
Incomplete schedule: An incomplete schedule is one where not all transactions have reached their final state, either commit or abort
T1: Read(A)
T1: Write(A)
T2: Read(B)\
T2: Write(B)
T2: commit
Here, T1 is still in progress, as there is no commit for transaction T1
Complete schedule: A complete schedule is one where all transactions in the schedule have either committed or aborted
T1: Read(A)
T1: Write(A)
T1:commit
T2: Write(B)
T2: commit
Types of schedule:
1. serial schedule: transaction executed one after another. menas wait for T1 to commit/ abort then t2 start
Advantage:
- It follows the ACID properties. transactions are isolated
- it mantaine consitency
challenges
- can be inefficient as there is poor throughput ( no of trans. completed per unit time)
- since wait time is high, less no of transcation are completed
2. Non-Serial/ Concurrent Schedule: where multiple transactions can execute simultaneously.
- We can say it as if there are two transcation T1 and T2, so T2 doesn't need T1 to commit, it can start at any point
Advantage:
- Better resource utilization
- throughput(no of transcation completed per unit time) is high
challenge
- A consistency issue may arise because of non-serial execution. so need roboust concurrency control mechanism to ensure data consistency and
- We can use serializability and concurrency control mechanisms to ensure consistency
3. Conflict- serializable Schedule :
4. View-serializable schedule :
5. Recoverable Schedule: If a transaction reads data from another transaction, it should not commit until the transaction from which it read has committed. this help in maintaining the integrity of the database in case a transaction fails
6. Irrecoverable Schedule: Allows a transaction to commit even if it has read data from another uncommitted transaction. This can lead to inconsistency and make it impossible to recover from certain failures
7. Cascading schedule: When the failures or abort of one transaction cause a series of other transcation also to also abort
8. Cascadeless Schedule: It ensures transactions only read committed data, such that the abort of one transaction does not lead to the other transaction that have alredy read its uncommitted changes
9. Strict Schedule: It ensures transcation is not allowed to read or write a data item that another transaction has written until the first transaction has either committed or aborted. it prevents cascading aborts
Comments
Post a Comment