Updated July 6, 2023
Introduction to Thomas write Rule
Thomas write rule is a concurrency control mechanism that is implemented to maintain and manage the concurrent transactions and processes in the database management system. It is an enhanced version of the timestamp ordering protocol that is useful for the concurrency control process. Thomas writes rule works on the process of ignoring outdated writes. It holds all the properties of time stamping protocol and manages the concurrent transactions that are associated with conflict serializability and view serializability scenarios. It is a useful protocol for the concurrent transactions that are associated with the predefined logical order from the beginning with the proper timestamp rules mapping.
How does Thomas write Rule work?
The Thomas write rules refer that, in the scenario of the latest transaction writes the data value of an object, then a less recent transaction which has missed the write operation in the time slot does not need to perform its own write operation as it will be overwritten by the more recent transaction eventually.
We will discuss the details with the transaction illustration.
Let us consider Transaction Ti issue the write operation for the data object Q. And TS is the time stamp for the write operation TS (Ti). Similarly, Tj is another transaction that operation on the same data object Q. And TS (Tj) is the time stamp for Tj transaction.
Thomas write rules says that while the Ti attempts to write the data item Q,
- If TS(Ti)<Write-timestamp(Q), then Ti is trying to write an obsolete value of Q.
- Thus, rather than rolling back the Ti as per the timestamp protocol methodology, the particular write operation can be ignored.
- Here the Write-timestamp (Q) is processed by TS (Tj) which is the latest transaction operation.
- Otherwise, the Thomas write rule works the same way as the timestamp ordering protocol for concurrency control.
It ensures greater control for concurrency transactions. Unlike the other concurrency protocols, it allows some of the view serializable schedules for the concurrent transactions that are not following the conflict serializable properties.
In other words, The Thomas write rule uses the view serializability by ignoring and deleting the obsolete write operations from the transactions that issue them as part of the related data operations.
Examples to Implement Thomas write Rule
As we discussed how the Thomas write rule works based on the time-stamp order. In this section, we will understand the ignoring obsolete write scenario.
The major concept for the obsolete write principle is that some of the transaction with timestamp TS has already written the value of the data object Q in the database. The associated transaction T2 has the timestamp ordering property is older compared to the initial transaction T1.
The following Transaction Table showing
The serializable schedule is not the conflict serializable.
It shows the operation sequence before applying the Thomas write rule.
Transaction T1 | Transaction T2 |
Read (Q)
Write(Q) Commit operation # Obsolete Write Operation |
Write(Q)
Commit operation |
The transaction table shows the two concurrent transaction T1 and transaction T2. The T1 starts with reading the data element Q which is the database object we are considering for this example.
In the subsequent timestamp ordering the transaction, T2 writes the sale database object Q without reading the data element. It is called a blind write process.T2 uses Write (Q) operation and commit the value in the database.
Subsequently, the transaction T1 writes the database object Q with Write (Q) operation. And commit the operation in the database. It shows the serializable schedule that does not conflict serializable.
It checks the write operation based on the timestamp. It will try to ignore one of the write operations among the two transactions. This example schedule shows Write (Q) in T1 is an obsolete write operation.
Instead of, rollback the T1 transaction and restart it again, Thomas writes rule says to ignore and delete the write operation for the time and continue the transactions for the subsequent operations.
After, the Thomas write rule is being applied the transaction table can be viewed as the following table.
Transaction T1 |
Transaction T2 |
Read (Q)
Commit operation |
Write(Q)
Commit operation |
The table shows the conflict serializability for the data object Q which is managed by Thomas write the rule for the concurrent transactions T1 and T2. Here transaction T2 which follows the latest timestamp ordering writes the data value and committing the written value to the database.
Advantages and disadvantages of Thomas write Rule
We will discuss some of the advantages and disadvantages of Thomas write the rule for the concurrency control process in the multi transaction systems.
Advantages
- It ensures view serializability by maintaining and controlling the write operation schedules of the concurrent transactions.
- The data object will be updated with the latest values based upon the write operation is done by the latest transaction.
- This protocol helps maintain the data consistency in the serializable schedule transaction systems.
- The Timestamp ordering for the Thomas write rule is an efficient technique for maintaining the check condition and controlling the write operations that changes the values of the data object in DBMS.
- It provides a better concurrency control mechanism that ensures efficient data consistency in a database management system.
Disadvantages
- It does not guarantee the conflict serializability for the concurrent transaction. However, it tries to maintain the view serializability schedule by ignoring the obsolete write operations from the transaction.
Conclusion
Thomas writes rule ensures that the outdated or missed write operation can be ignored for a particular sequence in the transaction comparing to the write operation timestamp of the data element made by another transaction with the latest timestamp. This protocol is popular due to the write operation control mechanism for maintaining data consistency.
Recommended Articles
This is a guide to Thomas write Rule. Here we discuss Introduction to Thomas write Rule, how does it work, examples, advantages, and disadvantages. You can also go through our other related articles to learn more –