Validation Based Protocol is also called Optimistic Concurrency Control Technique. This protocol is used in DBMS (Database Management System) for avoiding concurrency in transactions. It is called optimistic because of the assumption it makes, i.e. very less interference occurs therefore there is no need for checking while the transaction is executed.
In this technique, no checking is done while the transaction is been executed. Until the transaction end is reached updates in the transaction are not applied directly to the database. All updates are applied to local copies of data items kept for transaction. At the end of transaction execution, while execution of transaction, a validation phase checks whether any of transaction updates violate serializability. If there is no violation of serializability the transaction is committed and the database is updated; or else, the transaction is updated and then restarted.
Optimistic Concurrency Control is a tree phase protocol. The three phases for validation based protocol:
- Read Phase:
Values of committed data items from the database can be read by a transaction. Updates are only applied to local data versions.
- Validation Phase:
Checking is performed to make sure that there is no violation of serializability when the transaction updates are applied to database.
- Write Phase:
On the success of validation phase, the transaction updates are applied to the database, otherwise, the updates are discarded and the transaction is slowed down.
The idea behind optimistic concurrency is to do all the checks at once; hence transaction execution proceeds with a minimum of overhead until the validation phase is reached. If there is not much interference among transactions most of them will have successful validation, otherwise, results will be discarded and restarted later. These circumstances are not much favorable for optimization techniques, since, the assumption of less interference is not satisfied.
Validation based protocol is useful for rare conflicts. Since, only local copies of data is included in rollbacks, cascading rollbacks are avoided. This method is not favorable for longer transactions because they are more likely to have conflicts and might be repeatedly rolled back due to conflicts with short transactions.
- DBMS | Concurrency Control Protocol | Graph Based Protocol
- DBMS | Concurrency Control Protocols - Lock Based Protocol
- DBMS | Concurrency Control Protocol | Two Phase Locking (2-PL)-III
- DBMS | Concurrency Control Protocol | Two Phase Locking (2-PL)-II
- DBMS | Concurrency Control Protocol | Two Phase Locking (2-PL)-I
- DBMS | Concurrency Control Protocol | Thomas Write Rule
- DBMS | Concurrency Control Protocol | Multiple Granularity Locking
- DBMS | Log based recovery
- Difference between Stop and Wait protocol and Sliding Window protocol
- Operating System | Process-based and Thread-based Multitasking
- Memory based Vs Register based addressing modes
- DBMS | Advantages of DBMS over File system
- Difference between Stateless and Stateful Protocol
- Difference Between Go-Back-N and Selective Repeat Protocol
- Sliding Window Protocol | Set 3 (Selective Repeat)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.