Name: Mathew Yumbya Makau REG: 19/02580 Bit3202A: Distributed Database Systems Assignment 2
Name: Mathew Yumbya Makau REG: 19/02580 Bit3202A: Distributed Database Systems Assignment 2
Name: Mathew Yumbya Makau REG: 19/02580 Bit3202A: Distributed Database Systems Assignment 2
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.
• 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.