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 three 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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Graph Based Concurrency Control Protocol in DBMS
- Lock Based Concurrency Control Protocol in DBMS
- Log based Recovery in DBMS
- Main difference between Timestamp protocol and Thomos write rule in DBMS
- Types of Schedules based Recoverability in DBMS
- Difference between Stop and Wait protocol and Sliding Window protocol
- Difference between Memory based and Register based Addressing Modes
- Process-based and Thread-based Multitasking
- Difference between Preemptive Priority based and Non-preemptive Priority based CPU scheduling algorithms
- Two Phase Locking Protocol
- User Datagram Protocol (UDP)
- Gossip Protocol in Cassandra
- Difference between Stateless and Stateful Protocol
- Efficiency of Stop and Wait Protocol
- How Address Resolution Protocol (ARP) works?
- Distance Vector Routing (DVR) Protocol
- Protocol Hierarchies in Computer Network
- Types of Spanning Tree Protocol (STP)
- Internet Protocol version 6 (IPv6) Header
- File Transfer Protocol (FTP) in Application Layer
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.
Improved By : _as