Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

Presentation on:

Concurrency Control Based On Time Stamping

Submitted By: Submitted To:


Poojitha G L : 4GM21CS067 Dr. Maheswari L Patil
Ranjita U Kummur: 4GM21CS082 Associate Professor

Sanjana V Jadhav : 4GM21CS094 CSE Department


Shreya NMH : 4GM21CS100 GMIT, Davangere.
Concurrency Control in
Database Systems
Understanding concurrency control is essential for maintaining data integrity in
database systems. This presentation dives into the mechanisms of locking and
timestamp ordering, exploring how they ensure serializability and address
challenges such as deadlocks and rollbacks.
Locking and 2PL Protocol
1 Locking Mechanism
Locking is a fundamental concept in database concurrency control, used to manage
simultaneous transaction executions and maintain data integrity.

2 2PL Protocol
The Two-Phase Locking (2PL) protocol ensures that the schedules are serializable
and that transactions occur in a controlled manner.

3 Handling Deadlocks
While effective, the 2PL protocol can lead to deadlocks, requiring transactions to be
aborted and restarted to resolve conflicts.
Timestamps

Timestamps Deadlock Avoidance Timestamp Generation

Timestamps serve as unique Unlike locking mechanisms, Timestamps can be generated


identifiers for transactions, timestamp ordering does not use using a counter or the system
assigned in the order of locks, thereby eliminating the clock, ensuring each transaction
transaction submissions, and are possibility of deadlocks. has a distinct timestamp.
crucial for timestamp-based
concurrency control.
The Timestamp Ordering Algorithm for Concurrency Contr

Read and Write Operation Checks Conflict Serializable


Timestamps Schedules
The algorithm performs checks
Each database item is to ensure that conflicting By following the timestamp
associated with a read and write operations adhere to the order, the algorithm guarantees
timestamp, reflecting the latest timestamp order, aborting that the schedules produced are
transactions that have accessed transactions if necessary. conflict serializable.
the item.
Basic Timestamp Ordering (TO)
1 Read/Write Operations 2 Cascading Rollback
Transactions issue read or write Transactions may be rolled back in a
operations, which are checked against cascade if they depend on the operations
item timestamps to maintain order. of aborted transactions, highlighting a
challenge of basic TO.

3 Recoverability Protocols
To ensure recoverability, additional protocols are applied to the basic TO algorithm,
preventing non-recoverable schedules.
Strict Timestamp Ordering (STO)
Strict Schedules Delaying Operations
Strict Timestamp Ordering (STO) variation Operations are delayed until the relevant
ensures schedules are strict, aiding in transactions have committed or aborted,
easier recoverability. ensuring order and recoverability.

Lock Simulation
STO simulates the locking of items to manage access until transactions are resolved, without
causing deadlocks.
Thomas's Write Rule

1 2 3
Abort Ignore Execute
If a read timestamp is greater than If a write timestamp is greater, the When conditions allow, the write
the transaction's timestamp, the write operation is ignored to avoid operation is executed and the
transaction is aborted. outdated operations. write timestamp is updated.

You might also like