What is the main goal of using timestamp-based protocols in database management systems?
Think about how timestamps help maintain a consistent order of transactions.
Timestamp-based protocols assign each transaction a unique timestamp and ensure that conflicting operations follow the timestamp order. This maintains serializability without using locks.
Which two timestamps are maintained for each data item in a timestamp-based concurrency control protocol?
Consider timestamps related to reading and writing operations on data items.
Each data item keeps track of the largest timestamp of any transaction that has successfully read it (read timestamp) and the largest timestamp of any transaction that has successfully written it (write timestamp).
Consider two transactions T1 and T2 with timestamps TS(T1) = 5 and TS(T2) = 10. If T2 tries to write a data item that T1 has already read, what will happen under a timestamp-based protocol?
Recall that in timestamp ordering, a younger transaction can write an item read by an older transaction.
In timestamp-based protocols, if a younger transaction (higher timestamp) tries to write a data item previously read by an older transaction (lower timestamp), the write is allowed because it follows the timestamp order (older read before younger write). Thus, both transactions proceed.
How does Thomas' write rule improve upon the basic timestamp ordering protocol?
Consider how ignoring certain writes can help reduce unnecessary rollbacks.
Thomas' write rule allows a write operation to be ignored if the data item has already been written by a newer transaction, thus avoiding unnecessary aborts and improving concurrency.
Given 3 transactions T1, T2, and T3, each with unique timestamps, how many possible serial schedules are there that respect the timestamp order in a timestamp-based protocol?
Think about how timestamp ordering restricts the order of transactions.
Timestamp-based protocols enforce a strict order based on timestamps, so only one serial schedule is possible that respects this order.