what is concurrency control in dbms

1 year ago 62
Nature

Concurrency control in DBMS is a procedure of managing simultaneous operations or transactions without conflicting with each other. It is an essential feature of database management systems that assures data consistency and integrity in multi-user environments. Concurrency control protocols are the set of rules that are maintained to solve the concurrency control problems in the database. These protocols ensure that concurrent transactions can execute properly while maintaining the database consistency.

In a database transaction, the two main operations are READ and WRITE operations. It is important to manage these operations in the concurrent execution of transactions to maintain the consistency of the data. If these operations are not performed in an interleaved manner, the data may become inconsistent. The following problems occur with the concurrent execution of operations:

  • Lost Update Problem: When two transactions try to update the same data item, one transactions update may be lost.

  • Dirty Read Problem: When one transaction reads the uncommitted data of another transaction.

  • Unrepeatable Read Problem: When a transaction reads the same data item twice, but the data has been changed by another transaction in between.

  • Phantom Read Problem: When a transaction reads a set of records that satisfy a certain condition, but another transaction inserts or deletes records that also satisfy the same condition.

Concurrency control protocols can be classified into two categories: Timestamp-based protocols and Lock-based protocols. Timestamp-based protocols use timestamps to order transactions and ensure serializability. Lock-based protocols use locks to control access to data items and ensure serializability.

In summary, concurrency control in DBMS is a procedure that manages simultaneous transactions to ensure their atomicity, isolation, consistency, and serializability. It is required to maintain consistency of data in multi-user systems and to increase time efficiency.