Timestamp-based concurrency control
wikipedia Timestamp-based concurrency control
In computer science, a timestamp-based concurrency control algorithm is a non-lock concurrency control method. It is used in some databases to safely handle transactions, using timestamps.
Operation
Formal
Each transaction ({\displaystyle T_{i}}) is an ordered list of actions ({\displaystyle A_{ix}}). Before the transaction performs its first action ({\displaystyle A_{i1}}), it is marked with the current timestamp, or any other strictly totally ordered sequence: {\displaystyle TS(T_{i})=NOW()}. Every transaction is also given an initially empty set of transactions upon which it depends, {\displaystyle DEP(T_{i})=[]}, and an initially empty set of old objects which it updated, {\displaystyle OLD(T_{i})=[]}.
Each object {\displaystyle (O_{j})} in the database is given two timestamp fields which are not used other than for concurrency control: {\displaystyle RTS(O_{j})} is the time at which the value of object was last used by a transaction, {\displaystyle WTS(O_{j})} is the time at which the value of the object was last updated by a transaction.
For all {\displaystyle T_{i}}:
To abort: