4Q.
Explain Timestamping Methods:
1. Timestamp A unique identifier created by the DBMS that indicates the relative starting
time of a transaction.
2. Timestamping A concurrency control protocol that orders transactions in such a way that
older transactions, transactions with smaller timestamps, get priority in the event of conflict.
3. if a transaction attempts to read or write a data item, then the read or write is only
allowed to proceed if the last update on that data item was carried out by an older
transaction. Otherwise, the transaction requesting the read/ write is restarted and given a
new timestamp. New timestamps must be assigned to restarted transactions to prevent their
being continually aborted and restarted.
4. In addition to timestamps for transactions, there are timestamps for data items. Each data
item contains a read_timestamp, giving the timestamp of the last transaction to read the
item, and a write_timestamp, giving the timestamp of the last transaction to write (update)
the item.
timestamp ordering protocol works as follows:
If a transaction Ti issues a read(X) operation
If TS(Ti) < W-timestamp(X)
Operation rejected.
If TS(Ti) >= W-timestamp(X)
Operation executed.
All data-item timestamps updated.
If a transaction Ti issues a write(X) operation −
If TS(Ti) < R-timestamp(X)
Operation rejected.
If TS(Ti) < W-timestamp(X)
Operation rejected and Ti rolled back.
Otherwise, operation executed.
----------------------------------------------------------------------------------------------------------------------------------------
5Q. Explain Serializability
Serializability is the concept in a transaction that helps to identify which non-serial schedule
is correct and will maintain the database consistency. It relates to the isolation property of
transaction in the database.
Serializability is the concurrency scheme where the execution of concurrent transactions is
equivalent to the transactions which execute serially.
Serializable Schedule
A serial schedule is always a serializable schedule because any transaction only starts its
execution when another transaction has already completed its execution. However, a non-
serial schedule of transactions needs to be checked for Serializability.