The principal aim of database management systems encompasses the maintenance of the integrity and reliability of the database during failures in the software and hardware, as well as when several users that access the databases to conduct processes concurrently (Connolly & Begg, 2014). For the purposes of ensuring reliability and consistency, the database management systems offer three connected functions, which include transaction support, recovery as well as concurrency control methods.
Such processes help in the prevention of losses of data, management of transactions in case of access to the database by various users. In addition, concurrency control is a system that prevents several transactions on a database from interfering with each other (Connolly & Begg, 2014). On the other hand, optimistic together with pessimistic concurrency controls are those processes that control the access to the multi-user database (Menascé & Nakanishi,1982). It uses locking and time stamping in the holding and queuing of the processes to inhibit interference from other users. The approach begins with the notion that there is less likelihood of conflicts happening, and scans for conflicts when the transaction has started (Connolly & Begg, 2014; Menascé & Nakanishi, 1982).
The conservative concurrency system of control is usually used when there is high accumulation of transaction of conflicts. To shield transactions from interfering whereas several users are altering the database, this process applies a lock which declines the actions of the user who may try to interfere with the present or ongoing process. The lock stays intact until it is released by the user. The benefits of utilizing the pessimistic method are that it enhances data integrity and reliability by using the locking system. The benefit here is that the use of the locks in an environments of high data transaction volume causes leads to delays. Such a method is important in instances where data protection by the use of locks is more essential as compared to the delays brought about when there occurs data conflicts (Types of Concurrency Control, 2017).
The utilization of the optimistic concurrency control is done in a setting where transaction conflicts not likely to take pace. In this method, there is no use of the locks only if the users try to adjust the data. In addition, the lock is not used when the user only wants or is just reading the data. If the modification of the data is being performed by numerous users, the system would give an error which leads to rolling back the process. The user will be forced to initiate the transaction afresh. Whereas the advantages of using this method are that there are no locks needed. On the other hand, the disadvantages are that it rolls back the whole process and results to the users initiating the process again (Types of Concurrency Control, 2017). Nevertheless, in this approach, the use is notified about the conflict at the process’ end; the entire process notifies the user about a contention immediately they attempt reading the data (PESSIMISTIC vs. OPTIMISTIC concurrency control, 2017).
Example; In the optimistic concurrency, when the first user tries to update his or her health information in the segment of the health record, the second user is in a position of reading the same information. If the second user tries to update the same details that the first user did, they will be sent an error notification and then will be force to initiate the transaction when the first user releases the lock. In this method, a lock is used when the first user begins amending the data, and the second user will receive an error notification when they try reading the information. The first user can only be in a position of seeing or accessing the record when the first user releases the lock.
The pessimistic method has the assumption that more than a single user attempts to amend the same data and uses a lock on the process thread even when a contention in not occurring. The pessimistic concurrency method utilizes different kinds of lock, mutual, exclusive as well as updated. Depending on the kind of the lock, we find that users may be in a position of reading the data even if there is a lock in place. The optimistic concurrency method assumes that information contentions are likely to happen and only uses a lock more compared to a single user attempting to modify the same record. The system restarts the process and sends notification to the user.