0% found this document useful (0 votes)
25 views9 pages

Concurrency Control

Uploaded by

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

Concurrency Control

Uploaded by

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

TOPIC:

CONCURRENCY CONTROL
PRESSENTED BY:
LARAIB TARIQ(067372)
NAYAB KIYANI(067386)
MOMINA YASRUB(067377)
DEFINITION
CONCURRENCY CONTROL: CONCURRENCY
CONTROL REFERS TO THE TECHNIQUES AND
MECHANISMS USED TO MANAGE MULTIPLE
TRANSACTIONS THAT ACCESS SHARED DATA
SIMULTANEOUSLY. THIS IS NECESSARY TO ENSURE
THE INTEGRITY AND CONSISTENCY OF THE
DATABASE.
Goals of Concurrency Control
 Serializability: Ensure that the concurrent execution of
transactions is equivalent to some serial execution of the same
transactions.

 Recoverability: Ensure that the database can recover from failures


and maintain consistency.

 Avoidance of Deadlocks: Prevent situations where two or more


transactions are blocked, each waiting for the other to release
resources.
Concurrency Control
Techniques
1. Locking: Locking mechanisms grant exclusive access to a resource (e.g., a row or
table) to a transaction, preventing other transactions from accessing it until the lock
is released.
 - Shared Locks: Allow multiple transactions to read a resource simultaneously.
 - Exclusive Locks: Allow only one transaction to write to a resource.

2. Timestamping: Assign a unique timestamp to each transaction, ensuring that


transactions are executed in the order they were submitted.
3. Optimistic Concurrency Control: Assume that multiple transactions can
execute concurrently without conflicts, and only check for conflicts at commit time.
4. Pessimistic Concurrency Control: Assume that conflicts will occur, and use
locking or other mechanisms to prevent them.
5. Multiversion Concurrency Control: Maintain multiple versions of data, allowing
transactions to access different versions without conflicts.
Concurrency Control
Protocols:
1.Two-Phase Locking (2PL): A locking protocol that ensures
serializability by acquiring all necessary locks before releasing
any locks.

2. Strict 2PL: A variation of 2PL that ensures recoverability by


not releasing any locks until the transaction commits.

3. Serializable Snapshot Isolation (SSI): A protocol that


ensures serializability by maintaining a snapshot of the
database state for each transaction.
Challenges and Limitations

1.Deadlocks: Situations where two or more transactions are


blocked, each waiting for the other to release resources.

2.Starvation: Situations where a transaction is unable to


access a resource due to repeated denial by other
transactions.

3. Performance Overhead: Concurrency control


mechanisms can introduce performance overhead, such as
increased latency or decreased throughput.
Benefits of Concurrency
Control:
 1. Ensures Data Consistency: Concurrency control ensures
that transactions maintain the consistency of the data.

 2. Prevents Data Loss: Concurrency control prevents data loss


due to concurrent updates.

 3. Improves System Reliability: Concurrency control improves


system reliability by ensuring that transactions are executed
correctly even in the presence of failures.
Thank you!

You might also like