Graph Based Concurrency Control Protocol | Database Management System (DBMS) - Computer Science Engineering (CSE) PDF Download

Graph Based Concurrency Control Protocol in DBMS

As we know the prime problems with Lock Based Protocol has been avoiding Deadlocks and ensuring a Strict Schedule. We’ve seen that Strict Schedules are possible with following Strict or Rigorous 2-PL. We’ve even seen that Deadlocks can be avoided if we follow Conservative 2-PL but the problem with this protocol is it cannot be used practically. Graph Based Protocols are used as an alternative to 2-PL. Tree Based Protocols is a simple implementation of Graph Based Protocol.
A prerequisite of this protocol is that we know the order to access a Database Item. For this we implement a Partial Ordering on a set of the Database Items (D) {d1, d2, d3, ….., dn} . The protocol following the implementation of Partial Ordering is stated as-

  • If di → dj then any transaction accessing both di and dj must access di before accessing dj.
  • Implies that the set D may now be viewed as a directed acyclic graph (DAG), called a database graph.

Tree Based Protocol

  • Partial Order on Database items determines a tree like structure.
  • Only Exclusive Locks are allowed.
  • The first lock by Ti may be on any data item. Subsequently, a data Q can be locked by Ti only if the parent of Q is currently locked by Ti.
  • Data items can be unlocked at any time.

Following the Tree based Protocol ensures Conflict Serializablity and Deadlock Free schedule. We need not wait for unlocking a Data item as we did in 2-PL protocol, thus increasing the concurrency.
Now, let us see an Example, following is a Database Graph which will be used as a reference for locking the items subsequently.

Database GraphDatabase Graph

Let’s look at an example based on the above Database Graph. We have three Transactions in this schedule and this is a skeleton example, i.e, we will only see how Locking and Unlocking works, let’s keep this simple and not make this complex by adding operations on data.

Graph Based Concurrency Control Protocol | Database Management System (DBMS) - Computer Science Engineering (CSE)

From the above example, first see that the schedule is Conflict Serializable. Serializablity for Locks can be written as T2 → T1 → T3.
Data items Locked and Unlocked are following the same rule as given above and follows the Database Graph.
Thus, let’s revise once more what are the key points of Graph Based Protocols.

Advantage

  • Ensures Conflict Serializable Schedule.
  • Ensures Deadlock Free Schedule
  • Unlocking can be done anytime
  • With some advantages comes some Disadvantages also.

Disadvantage

  • Unnecessary locking overheads may happen sometimes, like if we want both D and E, then at least we have to lock B to follow the protocol.
  • Cascading Rollbacks is still a problem. We don’t follow a rule of when Unlock operation may occur so this problem persists for this protocol.

Overall this protocol is mostly known and used for its unique way of implementing Deadlock Freedom.

The document Graph Based Concurrency Control Protocol | Database Management System (DBMS) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Database Management System (DBMS).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
62 videos|66 docs|35 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Graph Based Concurrency Control Protocol - Database Management System (DBMS) - Computer Science Engineering (CSE)

1. What is a graph-based concurrency control protocol in DBMS?
Ans. A graph-based concurrency control protocol in DBMS is a technique used to manage concurrent access to data in a database system. It utilizes a graph structure to represent dependencies between transactions, enabling efficient scheduling and synchronization.
2. How does the graph-based concurrency control protocol GATE work?
Ans. The GATE protocol, which stands for Graph-based Asynchronous Transaction Execution, is a graph-based concurrency control protocol in DBMS. It uses a directed acyclic graph (DAG) to represent the dependencies between transactions. Each node in the graph represents a transaction, and edges represent conflicts between transactions. When a new transaction is initiated, it is added as a node in the graph. If there are no conflicts with existing transactions, it can be executed immediately. However, if conflicts exist, the transaction is added to a wait queue until all conflicting transactions have completed. Once the dependencies are resolved, the transaction is executed.
3. What are the advantages of the graph-based concurrency control protocol GATE?
Ans. The GATE protocol offers several advantages: 1. Deadlock avoidance: By using a directed acyclic graph (DAG), GATE ensures that there are no cycles in the dependencies between transactions, preventing the occurrence of deadlocks. 2. Efficient concurrency: GATE allows non-conflicting transactions to execute concurrently, improving system performance and reducing the overall execution time. 3. Scalability: The graph-based approach of GATE is highly scalable, as the size of the graph grows linearly with the number of transactions. This makes it suitable for large-scale database systems. 4. Asynchronous execution: GATE allows transactions to be executed asynchronously, reducing the waiting time and improving system responsiveness.
4. How does the graph-based concurrency control protocol GATE handle conflicts between transactions?
Ans. GATE handles conflicts between transactions by using a graph structure to represent dependencies. When a new transaction is initiated, it checks for conflicts with existing transactions. If conflicts are detected, the new transaction is added to a wait queue. The conflicting transactions are executed first, and once they complete, the dependencies are resolved. GATE ensures that there are no cycles in the graph, which prevents deadlocks. Once the dependencies are resolved, the new transaction is scheduled for execution.
5. Is the graph-based concurrency control protocol GATE suitable for real-time database systems?
Ans. The graph-based concurrency control protocol GATE may not be suitable for real-time database systems that require strict timing constraints. While GATE offers advantages such as efficient concurrency and scalability, it does not prioritize real-time transaction processing. Real-time database systems often require transactions to be executed within specific timing bounds, which may not be guaranteed by GATE's asynchronous execution model. Therefore, alternative concurrency control protocols specifically designed for real-time systems may be more appropriate in such cases.
62 videos|66 docs|35 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Free

,

Graph Based Concurrency Control Protocol | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

Graph Based Concurrency Control Protocol | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

ppt

,

Exam

,

mock tests for examination

,

pdf

,

practice quizzes

,

Viva Questions

,

shortcuts and tricks

,

Sample Paper

,

video lectures

,

Objective type Questions

,

Graph Based Concurrency Control Protocol | Database Management System (DBMS) - Computer Science Engineering (CSE)

,

Semester Notes

,

Extra Questions

,

MCQs

,

Previous Year Questions with Solutions

,

Summary

,

past year papers

,

study material

,

Important questions

;