In the fields of computer science and information technology there are often transactions, operations or jobs that are executed to gather a result. In most cases these results come in bunches and many separate transactions may have to occur at the same time. The process of managing simultaneous execution of transactions while ensuring the serializability of transactions in a database is known as concurrency control.
Concurrency control is essential to allow software to perform the way it should. In robust distributed systems it is extremely common to have multiple transactions occur which need access to the same data. One easy way of achieving this guarantee is to ensure that only one transaction executes at a time by using mutual exclusion and having a transaction resource that each transaction must have access to. This would likely be overkill and utilize concurrency controls. In the case of multiple transactions which use the same data and execute simultaneously concurrency control will keep them out of each other’s way and ensure serializability.
One way of achieving concurrency is by using locks. Locks will have a transaction lock an object and prevent another transaction from manipulating the object until the lock is released after the initial transaction completes. There is also the optimistic concurrency control. This is based on the observation that in most applications the chance of two transactions accessing the same object is low. This allows transactions to proceed as if there were no possibility of conflict with other transactions ie. A transaction does not have to obtain or check for locks.
Another control is timestamp ordering. In timestamp ordering, transactions are assigned a unique timestamp when it begins. Each object in the system has a read and a write timestamp associated with it. The read timestamp is the timestamp of the last