Full Transcript

CONCURRENCY CONTROL Esther Kamau-668700 CONCURRENCY CONTROL Concurrency Control Is the process of managing simultaneous operations on a database without having them interfere with each other. Concurrency control is a very important concept of DBMS which ensures the simultaneou...

CONCURRENCY CONTROL Esther Kamau-668700 CONCURRENCY CONTROL Concurrency Control Is the process of managing simultaneous operations on a database without having them interfere with each other. Concurrency control is a very important concept of DBMS which ensures the simultaneous execution or manipulation of data by several processes or users without resulting in data inconsistency. Concurrency Control deals with interleaved execution of more than one transaction. CONCURRENCY CONTROL PROTOCOLS Concurrency control protocols are the set of rules that are maintained to solve the concurrency control problems in the database. It ensures that the concurrent transactions can execute properly while maintaining the database consistency. The concurrent execution of a transaction is provided with atomicity, consistency, isolation, durability, and serializability via the concurrency control protocols. 1. Locked based Protocol In locked-based protocol, each transaction needs to acquire locks before they start accessing or modifying the data items. 2.Timestamp based Protocol In this protocol each transaction has a timestamp attached to it. The timestamp is nothing but the time in which a transaction enters the system. Waiting Time: It means if a process is in a ready state but still the process does not get the system to execute is called waiting time. So, concurrency leads to less waiting time. ADVANTAGES Response Time: The time wasted in getting the response from the cpu for the first time, is called response time. So, concurrency leads to less OF Response Time. CONCURREN Resource Utilization: The amount of Resource utilization in a particular system is called Resource CY Utilization. Multiple transactions can run parallel in a system. So, concurrency leads to more Resource Utilization. Efficiency: The amount of output produced in comparison to given input is called efficiency. So, Concurrency leads to more Efficiency. DISADVANTAGES OF CONCURRENCY  Overhead: Implementing concurrency control requires additional overhead, such as acquiring and releasing locks on database objects. This overhead can lead to slower performance and increased resource consumption, particularly in systems with high levels of concurrency.  Deadlocks: Deadlocks can occur when two or more transactions are waiting for each other to release resources, causing a circular dependency that can prevent any of the transactions from completing. Deadlocks can be difficult to detect and resolve and can result in reduced throughput and increased latency.  Reduced concurrency: Concurrency control can limit the number of users or applications that can access the database simultaneously. This can lead to reduced concurrency and slower performance in systems with high levels of concurrency.  Complexity: Implementing concurrency control can be complex, particularly in distributed systems or in systems with complex transactional logic. This complexity can lead to increased development and maintenance costs.  Inconsistency: In some cases, concurrency control can lead to inconsistencies in the database. For example, a transaction that is rolled back may leave the database in an inconsistent state, or a long-running transaction may cause other transactions to wait for extended periods, leading to data staleness and reduced accuracy.

Use Quizgecko on...
Browser
Browser