Thursday, September 10, 2026
Home Academic Timestamp ordering concurrency control technique - An introduction

Timestamp ordering concurrency control technique – An introduction

A concurrency management method called timestamp ordering employs timestamps to arrange transactions and guarantee serializability. Each transaction is given a distinct timestamp when it is initiated, which is how it operates. When the transaction is finished being executed, the timestamp is used to rank it in relation to other transactions.

This is an illustration of how timestamp ordering functions:

Timestamp Ordering Protocol Execution Timeline
Time Step Transaction 1
TS(T1) = 1
Transaction 2
TS(T2) = 2
Transaction 3
TS(T3) = 3
Data State & Timestamp Rules
t1 Begin (Assigned TS = 1) T1 initializes with oldest timestamp.
t2 Begin (Assigned TS = 2) T2 assigned younger timestamp.
t3 Begin (Assigned TS = 3) T3 assigned youngest timestamp.
t4 Read(D1) Valid: T2 reads data written by T1.
TS(T2) ≥ W-TS(D1)
t5 Write(D2) T1 writes new item D2.
Sets W-TS(D2) = 1
t6 Read(D2) Valid: T3 reads data written by T1.
TS(T3) ≥ W-TS(D2)

Simply,

Step 1 Transaction 1 begins, and a timestamp of 1 is assigned to it.
Step 2 Transaction 2 begins, and its timestamp is set to 2.
Step 3 Transaction 3 begins, and its timestamp is set to 3.
Step 4 Data written by Transaction 1 is read by Transaction 2.
Step 5 New data is written in Transaction 1.
Step 6 The information that Transaction 1 wrote is read by Transaction 3.

In DBMS Lecturer’s Language 😉 FYI, I was a Lecturer earlier. Haha!

  • Timestamp Assignment (TS): Each transaction Ti is assigned a unique, monotonically increasing timestamp upon entry (TS(T1) = 1, TS(T2) = 2, TS(T3) = 3).
  • Read-Timestamp R-TS(X) & Write-Timestamp W-TS(X): Every data item tracks the timestamp of the youngest transaction that successfully read or wrote to it.
  • Concurrency Validation:
    • When T2 reads data written by T1, the system validates TS(T2) ≥ W-TS(D1) (2 ≥ 1). Since T2 is younger, the read is valid and preserves serializability.
    • Similarly, when T3 reads D2 written by T1, TS(T3) ≥ W-TS(D2) (3 ≥ 1), which is allowed without conflict.

The transactions in this example are carried out in the following succession: 1, 2, 3. This is due to the fact that the timestamps attached to each transaction show the chronological sequence in which they were initiated.

Below is a typical timestamp ordering algorithm:

Simple One (Works for Business Related Courses)

STEP 1 Timestamp Generation: Assign each transaction a unique time-stamp token the exact moment it enters the system.
STEP 2 Conflict Inspection: Compare the active transaction’s timestamp against prior operations whenever a Read or Write is requested.
STEP 3 Queue Delay: Pause and wait if an older transaction needs to complete before newer operations can safely proceed.
STEP 4 Execution Clearance: Instantly execute the transaction if its timestamp proves it holds priority over conflicting operations.
STEP 5 Serial Ranking: Finalize the transaction’s permanent position in history based on its original birth timestamp.

Technical One (Works for IT Related Courses)

Algorithm: Timestamp Ordering Protocol
— Initialization
For each data item X: Initialize R-TS(X) = 0, W-TS(X) = 0.

1. TRANSACTION BEGIN (Ti):
Assign TS(Ti) = current_global_timestamp;
current_global_timestamp++;

2. Ti REQUESTS READ(X):
If (TS(Ti) < W-TS(X))
  Then Abort and Rollback Ti;
  Else Allow Read AND Set R-TS(X) = Max(R-TS(X), TS(Ti));

3. Ti REQUESTS WRITE(X):
If (TS(Ti) < R-TS(X) OR TS(Ti) < W-TS(X))
  Then Abort and Rollback Ti;
  Else Allow Write AND Set W-TS(X) = TS(Ti);

4. Ti COMMIT/ABORT:
History preserves serializability based on original entry order.

Thanks for bearing me up-to this point!
Happy Learning!
– Sagar Sir

datasagarhttp://www.DataSagar.com
Sagar is multidisciplinary technologist, educator, and entrepreneur based in Nepal. As the founder of Illionso Technologies and Kashi Garden Resort, he operates at the intersection of web architecture, data intelligence, innovation, and digital transformation. From building digital solutions to scaling real-world concepts, his mission is to share knowledge alongside merge emerging as well as disruptive technologies with transformative offline experiences.
RELATED ARTICLES

Meta Muse AI Agent Everything You Need to Know About Features and Privacy

Discover everything about Meta Muse, the new personal AI agent designed to execute goals 24/7. Explore its features, Secure Virtual Machine privacy, token pricing, and the future of autonomous AI.

Nepal Government Approves Software Development Center to Hire 93 IT Specialists – Gov Tech Updates

Nepal is taking a massive step forward in government technology. The administration has formally advanced plans...

Most Popular