0% found this document useful (0 votes)
7 views1 page

Mod 6-I

Uploaded by

sakthiramk2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Mod 6-I

Uploaded by

sakthiramk2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Concurrency control

Concurrency control is a crucial aspect of database management systems (DBMS) that deals with
managing simultaneous operations or transactions on a shared database. It ensures that the
database remains consistent and correct even when multiple users or processes are accessing and
modifying the data concurrently.

In a multi-user environment, it is common for multiple transactions to access and modify the same
data items simultaneously. Without proper concurrency control, this can lead to various data
inconsistencies, such as lost updates, dirty reads, non-repeatable reads, and phantom reads. These
issues can compromise the integrity and reliability of the database.

Concurrency control mechanisms aim to prevent such inconsistencies by enforcing certain rules and
protocols on the execution of transactions. Some of the commonly used concurrency control
techniques include:

1. Locking: This is the most common method of concurrency control. It involves acquiring locks on
data items before accessing or modifying them. There are two types of locks: shared locks (allowing
other transactions to read the data item) and exclusive locks (preventing other transactions from
reading or modifying the data item).

2. Timestamp ordering: In this method, each transaction is assigned a unique timestamp when it
begins. Transactions are then ordered based on their timestamps, and conflicts are resolved by
allowing the transaction with the earlier timestamp to proceed.

3. Optimistic concurrency control: This method assumes that conflicts between transactions are rare
and allows transactions to proceed without locking data items. Before committing, the transaction
checks if any other transaction has modified the data items it accessed. If there are no conflicts, the
transaction is committed; otherwise, it is rolled back and retried.

4. Serializability: This is a property that ensures that the outcome of concurrent transactions is
equivalent to some serial execution of those transactions. Serializability can be achieved using
various techniques, such as two-phase locking (2PL), timestamp ordering, or serializable snapshot
isolation (SSI).

By implementing these concurrency control mechanisms, a DBMS can ensure that the database
remains consistent and correct, even in the presence of concurrent transactions. This is essential for
maintaining data integrity and providing reliable access to the data for all users.

You might also like