DBMS Presentation
DBMS Presentation
Introduction
Problems with Concurrent Execution
Classification of Concurrency Control protocols
Lock-based protocols
Types of lock-based protocols
Timestamp-based protocols
Introduction
• Concurrency control manages the transactions simultaneously
without letting them interfere with each another.
• The main objective of concurrency control is to allow many users
perform different operations at the same time.
• Using more than one transaction concurrently improves the
performance of system.
• If we are not able to perform the operations concurrently, then there
can be serious problems such as loss of data integrity and
consistency.
• Concurrency control increases the throughput because of handling
multiple transactions simultaneously.
• It reduces waiting time of transaction.
3
• For example:
4
Problems with Concurrent
Execution
• Lost Update Problems (W-W Conflict):
The problem occurs when two different
database transactions perform the
read/write operations on the same
database items in an interleaved manner
(i.e., concurrent execution) that makes
the values of the items incorrect hence
making the database inconsistent.
6
Lock-based Protocols
• Lock is a mechanism which is important in a concurrent control.
• It controls concurrent access to a data item.
• It assures that one process should not retrieve or update a record
which another process is updating.
• If the locking is not done properly, then it will display the inconsistent
and corrupt data.
• It manages the order between the conflicting pairs among transactions
at the time of execution.
• For example, in traffic, there are signals which indicate stop and go.
When one signal is allowed to pass at a time, then other signals are
locked. Similarly, in database transaction only one transaction is
performed at a time and other transactions are locked.
7
Types of lock-based protocols
8
Timestamp-based Protocols
• Timestamp Based Protocol helps DBMS to identify the transactions.
• It is a unique identifier. Each transaction is issued a timestamp when
it enters into the system.
• Timestamp protocol determines the serializability order.
• It is most commonly used concurrency protocol.
• It uses either system time or logical counter as a timestamp.
• It starts working as soon as a transaction is created.
9
THANK YOU
10