Outdated Write Example
The main update in Thomas Write Rule is ignoring the Obsolete Write Operations. This is done because some transaction with a timestamp (TS) greater than TS(T) (i.e., a transaction after T in TS ordering) has already written the value of X. Hence, logically user can ignore the Write(X) operation of T which becomes obsolete. Let us see this through an example:
Suppose a user has a schedule in which two transactions T1 and T2. Now, TS(T2) < TS(T1). This means T1 arrived after T2 and hence has a larger TS value than T2. This implies that the serializability of the schedule allowed is T2 –> T1. Consider the partial schedule given below:
Obsolete Writes are hence ignored in this rule which is in accordance with the 2nd protocol. It seems to be more logical as users skip an unnecessary procedure of restarting the entire transaction. This protocol is just a modification to the Basic TO protocol.
T1 | T2 |
---|---|
R(A) | |
W(A) | |
Commit | |
W(A) | |
Commit |
The above table is showing a Serializable Schedule that is not a Conflict Serializable.
T1 | T2 |
---|---|
R(A) | Commit |
W(A) | |
Commit |
The above table is showing a Conflict Serializable Schedule.
Thomas Write Rule in DBMS
The “write rule” in database management systems (DBMS) refers to a principle that governs how changes to the database are handled. Specifically, the write rule states that any modification to a database must be written to disk before control is returned to the user.
In other words, when a user executes a command that modifies the database (such as an update or delete statement), the DBMS must ensure that the change is permanently saved to disk before the user is allowed to continue with other actions. This ensures that the database remains consistent and durable, even in the event of system failures or crashes.
The Write Rule is one of the fundamental principles of database management and is an important part of ensuring data integrity and reliability
Timestamp Ordering Protocol states that if Ri(X) and Wj(X) are conflicting operations then Ri (X) is processed before Wj(X) if and only if TS(Ti) < TS(Tj). Whenever a schedule does not follow a serializability order according to the Timestamp, a user generally rejects it and rollback the Transaction. Some operations on the other hand are harmless and can be allowed.
Thomas Write Rule allows such operations and is a modification of the Basic Timestamp Ordering protocol. In Thomas Write Rule users ignore outdated writes. Moreover, of all the Concurrency Protocols that have been discussed, Concurrency is imposed on Schedules that are Conflict Serializable, in Thomas Write Rule, the most important improvement is a user can achieve Concurrency with View Serializable schedules.
First, let’s state what is Thomas Write Rule and then what are modifications and improvements it succeeds over the Basic TO protocol.