Menu

How Databases Safely Ignore Obsolete Writes: Thomas Write Rule Explained
πŸ“°

How Databases Safely Ignore Obsolete Writes: Thomas Write Rule Explained

DEV Community: beginnersΒ·Binary DoseΒ·19 days ago
#Q3HUFy0w
#devtobeginners#devto#dev#write#transaction
Long article (382 words) β€” no AI summary yet.
Reading 0:00
15s threshold

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!…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.