![]() |
VOOZH | about |
The Thomas Write Rule (TWR) is an extension of the Basic Timestamp Ordering (TO) Protocol used for concurrency control in Database Management Systems (DBMS).
Note: It allows higher concurrency by ignoring obsolete writes instead of aborting transactions, as long as doing so doesn’t affect the final database state.
In the Basic Timestamp Ordering (TO) protocol, if a transaction tries to write an outdated value, it is aborted. However, in the Thomas Write Rule, instead of aborting, the outdated write is ignored, allowing the transaction to continue.
Note: This helps avoid unnecessary aborts and increases system throughput.
| Symbol | Meaning |
|---|---|
| TS(T) | Timestamp of transaction T |
| R_TS(X) | Timestamp of the last read on data item X |
| W_TS(X) | Timestamp of the last write on data item X |
The main improvement in Thomas Write Rule is that it ignores obsolete (outdated) writes instead of rejecting transactions. This happens when a newer transaction has already updated a value, making the older transaction's write operation unnecessary. Let's consider two transactions:
| Step | Operation | Description |
|---|---|---|
| 1 | T2: W2(X) | T2 writes X (sets W_TS(X) = TS(T2)) |
| 2 | T1: W1(X) | T1 tries to write X (TS(T1) > W_TS(X)) |
| 3 | T1's write is ignored | Since T2 has already written X, T1’s write is obsolete and ignored instead of rollback |
Consider the partial schedule given below - Obsolete Writes are hence ignored in this rule which is in accordance with the 2nd protocol.
Note: 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 |
| Aspect | Basic Timestamp Ordering (TO) | Thomas Write Rule (TWR) |
|---|---|---|
| Basis | Strict timestamp checking for reads/writes | Modified TO that ignores outdated writes |
| Outdated Writes | Transaction aborted | Write ignored |
| Type of Serializability | Conflict serializable | View serializable (not always conflict serializable) |
| Concurrency Level | Low (more rollbacks) | Higher (fewer rollbacks) |
| System Throughput | Low | High |