How Databases Safely Ignore Obsolete Writes: Thomas Write Rule Explained
In distributed databases and concurrency control, standard locking mechanisms (like 2PL) can cause painful deadlock cycles and lock contention.
To solve this, database engines use Timestamp Ordering (TSO) : transactions execute lock-free, ordered by logical timestamps TS(T) .
β‘ The Standard Timestamp Ordering Conflict
For every data record Q , the database tracks two timestamps:
R-TS(Q) : The largest timestamp of any transaction that read Q .
W-TS(Q) : The largest timestamp of any transaction that wrote to Q .
Under standard Timestamp Ordering, when an older transaction Tβ ( TS = 10 ) attempts to execute write(Q) after a newer transaction Tβ ( TS = 20 ) has already updated Q :
Time βββββββββββββββββββββββββββββββββββββββββββββββββββββββββΊ T1 (TS = 10) ββββ attempts write(Q) ββββΊ π₯ CONFLICT!β¦