Concurrency Control in Distributed Db (M3.2)

 Concurrency controlling techniques ensure that multiple transactions are executed simultaneously while maintaining the ACID properties of the transactions and serializability in the schedules.

Concurrency control is provided in a database to:

  • enforce isolation among transactions.
  • preserve database consistency through consistency preserving execution of transactions.
  • resolve read-write and write-read conflicts

Various approaches for concurrency control

 1. Locking Protocols (Locking Based Concurrency Control Protocols)

Locking-based concurrency control protocols use the concept of locking data items. A lock is a variable associated with a data item that determines whether read/write operations can be performed on that data item. Generally, a lock compatibility matrix is used which states whether a data item can be locked by two transactions at the same time.

Locking-based concurrency control systems can use either one-phase or two-phase locking protocols.

1.1 Single Lock-Manager Approach 

In the single lock-manager approach, the system maintains a single lock manager
that resides in a single chosen site. 

In this method, each transaction locks an item before use and releases the lock as soon as it has finished using it. This locking method provides for maximum concurrency but does not always enforce serializability.

Advantages:

  • Simple implementation. This scheme requires two messages for handling lock requests and one message for handling unlock requests. 
  • Simple deadlock handling. Since all lock and unlock requests are made at one site.
 Disadvantages 

• Bottleneck. The site Si becomes a bottleneck, since all requests must be processed there.
• Vulnerability. I
f the site S i fails, the concurrency controller is lost. Either
processing must stop, or a recovery scheme must be used so that a backup
site can take over lock management from S i.

1.2 Distributed Lock Manager

1.3 Primary Copy

1.4 Majority Protocol

1.5 Biased Protocol

1.6 Quorum Consensus Protocol

2. Time-stamping

3. Replication with Weak Degrees of Consistency 

4. Deadlock Handling

 


No comments:

Post a Comment

Monk and Inversions

using System; public class Solution { public static void Main () { int T = Convert . ToInt32 ( Console . ReadLine...