Optimistic Concurrency Control is based on the assumption that database transactions don't conflict with other transactions, and that allows OCC to be as permissive as possible in allowing transactions to execute.
There are three phases in OCC:
1. READ: Transaction executes, reading values, writing to a private sandbox.
2. VALIDATION: When transaction commits, the database checks if the transaction could have possibly conflicted with any other concurrent transaction. If there is a possibility, the transaction aborts, and restarted.
3. WRITE: If there is no possibility of conflict, the transactions commits.
If there are few conflicts, validation can be done efficiently, and leads to better performance than other concurrency control methods. Unfortunately, if there are many conflicts, the cost of repeatedly restarting transactions, hurts performance significantly.
Search Encyclopedia
|
Featured Article
|