0% found this document useful (0 votes)
43 views2 pages

Timestamp Concurrency Control DBMS

Uploaded by

sai351689
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views2 pages

Timestamp Concurrency Control DBMS

Uploaded by

sai351689
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Timestamp-Based Concurrency Control in DBMS

Time-Stamp Transaction Protocol is a concurrency control technique in DBMS that uses timestamps

to order transactions and ensure serializability.

Key Concepts:

1. Timestamp (TS):

- Each transaction T is given a unique timestamp TS(T).

- Older transactions have smaller timestamps.

2. Read_TS(X):

- Highest timestamp of any transaction that successfully read X.

3. Write_TS(X):

- Highest timestamp of any transaction that successfully wrote to X.

Rules:

1. Read(X) by T:

- If TS(T) < Write_TS(X): Abort T.

- Else: Allow read, update Read_TS(X).

2. Write(X) by T:

- If TS(T) < Read_TS(X) or TS(T) < Write_TS(X): Abort T.

- Else: Allow write, update Write_TS(X).


Abort Policy:

- On abort, transaction is rolled back and restarted with a new timestamp.

Example:

- TS(T1) = 5, TS(T2) = 10

- T2 writes to X: Write_TS(X) = 10

- T1 tries to read X: TS(T1) < Write_TS(X) => T1 is aborted.

Pros:

- Simple implementation

- Avoids deadlocks

- Ensures serializability

Cons:

- Can cause many aborts under high contention

You might also like