Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
25 views3 pages

Name: Mathew Yumbya Makau REG: 19/02580 Bit3202A: Distributed Database Systems Assignment 2

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

NAME: MATHEW YUMBYA MAKAU

REG: 19/02580
BIT3202A: DISTRIBUTED DATABASE SYSTEMS
ASSIGNMENT 2
a). What are the various concurrency control techniques? Compare Lock
based Concurrency Control strategies in detail.

I. Shared Lock: If the transaction has acquired a shared lock on a data item Q
than its own perform only read operation but if a transaction has acquired
exclusive lock then it can perform read as well as write operation.

II. Locked Based Protocol: In locked based protocol basic idea is first to acquire
a lock before accessing a data item directly after use should delete that data
item. Because of this, we can avoid a clash. Here transaction uses types of
locks. Shared lock and exclusive lock.

III. Two phase Locking: In two-phase locking every transaction work in 2 phase in
the entire span. Growing phase and shrinking phase. In the growing phase, only
a transaction may acquire locks but cannot release only lock while in shrinking
phase a transaction can only release lock but cannot any acquire any lock.
Growing and shrinking phase terminology is applicable to the transaction not
suitable.

IV. Time stamping Protocol: In this method, we decide to order before transaction
enters into the system here every transaction is given time stamp Ts(Ti) which
is actually the value of the system clock when the transaction enters into the
system. This time stamp will remain constant until the transaction is in the
system.

V. Conservative 2 phase Locking: In conservation 2 phase locking we remove


growing phase from the system and every transaction is first required to acquire
all the lock first before performing any read or write. It ensures conflict
serializability view serializability and deadlock independence but suffers from
recoverability and cascades.
• Lock-based protocols manage the order between the conflicting pairs among
transactions at the time of execution, whereas timestamp-based protocols
start working as soon as a transaction is created. Every transaction has a
timestamp associated with it, and the ordering is determined by the age of
the transaction.

b). Compare Distributed Deadlock prevention to Distributed Deadlock


Avoidance. Explain one scheme of Distributed deadlock Detection and
Recovery.

• A deadlock prevention method assures that at least one of the four deadlock
conditions never occurs. In contrast, the deadlock avoidance mechanism
prevents the system from coming to an unsafe state.
• All resources are requested at once in deadlock prevention. In contrast, the
resource requests are manipulated in deadlock avoidance until at least one
secure path is found.
• Preemption is more common in deadlock prevention. In contrast, deadlock
avoidance doesn't involve preemption.
• There are some algorithms in deadlock prevention, including Non-blocking
synchronization and serializing tokens algorithms. On the other hand, the
most widely used algorithm in deadlock avoidance is Banker's algorithm.
• The knowledge of future process resource requirements is not required for
deadlock prevention. On the other hand, deadlock avoidance necessitates an
understanding of future process resource requests.

Explain one scheme of Distributed deadlock Detection and Recovery.


➢ Killing all the Processes involved in the deadlock. Killing process
one by one. After killing each process check for deadlock again keep
repeating the process till the system recovers from deadlock. Killing
all the processes one by one helps a system to break circular wait
condition.

You might also like