Distributed Lock-Manager Approach
In this
approach, the function of lock-manager is distributed over several sites.
[Every DBMS server (site) has all the components like Transaction
Manager, Lock-Manager, Storage Manager, etc.]
In Distributed
Lock-Manager, every site owns the data which is stored locally.
- This is true for a table that is fragmented into n fragments and stored in n sites. In this case, every fragment is unique from every other fragment and completely owned by the site in which it is stored. For those fragments, the local Lock-Manager is responsible to handle lock and unlock requests generated by the same site or by other sites.
- If the data stored in a site is replicated in other sites, then a site cannot own the data completely. In such case, we cannot handle any lock request for a data item stored in a site as the case of fragmented data. If we handle like fragmented data, it leads to inconsistency problems as there are multiple copies stored in several sites. This case can be handled using several protocols which are specifically designed for handling lock requests on replicated data. The protocols are,
Advantages:
- Simple implementation is required for the data which are fragmented. They can be handled as in the case of Single Lock-Manager approach.
- For replicated data, again the work can be distributed over several sites using one of the above listed protocols.
- Lock-Manager site is not the bottleneck as the work of lock-manager is distributed over several sites.
Disadvantages:
- Handling of Deadlock is difficult, because, a transaction T1 which acquired a lock on a data item Q at site S1 may be waiting for lock on another data item R as site S2. This wait is genuine or a deadlock has occurred is not easily identifiable.
Lock handling is done using the regular
procedure;
Locks can be granted by
the lock-manager if the data item requested is available freely, or locked in
a compatible mode.
Granting of locks can be
delayed, if the data item is already locked by other transaction in an
incompatible mode.
|
Help Others
If You Can
|