Optimistic concurrency control sets few locks on the data in the database, lower
ID: 3552784 • Letter: O
Question
Optimistic concurrency control sets few locks on the data in the database, lowering the isolation level that you use in an application. This allows more applications to run concurrently and potentially increases the throughput of the applications. This strategy attempts to obtain locks on the required resources only when the transaction completes.
Pessimistic concurrency control implements a higher isolation level by placing locks on the database at the beginning of a transaction. In other words, pessimistic locking assumes there will be a collision in the database and takes precautions to prevent these collisions. A pessimistic locking strategy protects the integrity of the database by guaranteeing, from the beginning of the transaction, that no conflicting transaction can run concurrently.
The optimistic concurrency control strategy always allows a transaction to start but cannot guarantee that it will complete. The pessimistic locking strategy cannot guarantee that a transaction will be able to start, but it guarantees that, once started, any transaction can complete.
A data warehouse has many fetches, or SELECTs, and few DMLs, or UPDATEs, INSERTs, and DELETEs. An online transaction processing (OLTP) application usually has many DMLs and few SELECTs. Remember that rows selected from a partially complete transaction may not be consistent.
Discuss the following points:
Explanation / Answer
1.
Benefit:
Optimistic concurrency:
Fast operations do carry out which is needed in OLTP.
OLTP system requires many data manipulation like inserts, delete, updates rather
than selection operation. OLTP system does the operation very fast as compare to other
systems. That is the main reason of choosing the optimistic concurrency for online
transaction processing system. Optimistic concurrency system first start the transaction
execution without bothering about the circumstances that whether it will be able to finish the task or not. If we talk about the performance and speed the optimistic concurrency gives better result in OLTP.
Pessimistic concurrency:
To control and run fundamental business task.
OLTP is used to run the fundamental business task and control their processing. Since the pessimistic concurrency control do locks all the required variable before start the execution and inlock them only after finishing the execution it provides the best control on the system. Pessimistic concurrency control ensures the successful execution of the task.
Drawback:
Optimistic concurrency:
Failure rate of the transactions are very high in the optimistic concurrency control.
Since optimistic concurrency control start the task without taking care about the future problems like transaction execution going into the loop etc. in that situation when the failure rate is very high the OLTP will not give the good performance.
Pessimistic concurrency:
Starvation problem within the transactions.
Since the pessimistic concurrency control first locks the required variables. Sometime the tasks which come late in the system used to wait till the completion of the previous transaction which is holding the resources.
2.
Benefit:
Optimistic concurrency:
These are highly flexible.
Sine the maximum operations in the data ware house is only read, thus the optimistic concurrency is the best for accessing the data from the data ware house. If all the operations in the transaction system is read operation the system will never go in deadlock or failure condition.
Pessimistic concurrency:
These are highly trustworthy.
Since it does not allow other users to perform the operation at the same time for the same kind of the data thus it is very trustful that the information retrieve is the same which the user needed.
Drawback:
Optimistic concurrency:
Lack of consistent data.
Optimistic concurrency does not lock the variable before accessing them. Thus, there is a possibility that user can get wrong file.
Pessimistic concurrency:
Accessing speed of the data is very low.
Since the pessimistic concurrency control does not allow other’s user to access the same data at the same time it performance is very low.
3.
Optimistic concurrency:
For the big organizational data like country data optimistic concurrency is the best.
Pessimistic concurrency:
For the small organizational data like college data pessimistic concurrency is the best.
4.
Optimistic concurrency: Effects of the following types of the user on the choices.
Computer program: Compute program will take more time.
Internal business user: Business worker will work fine in this scenario.
Customer on the web: Customer on the web may lose his request or his request can go for infinite loop search.
Pessimistic concurrency: Effects of the following types of the user on the choices.
Computer program: Compute program will always get the correct information.
Internal business user: Business worker will go slow.
Customer on the web: Customer on the web will always get his request. In this scenario no need to wait for long time.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.