Database Concurrency Assignment
Database Concurrency Assignment
BSCIT-01-0387/2019
- First, notice that the larger the data item size is, the lower the degree of concurrency
permitted. For example, if the data item size is a disk block, a transaction T that needs
to lock a record B must lock the whole disk block X that contains B because a lock is
associated with the whole data item (block).
The factors that affect selection of granularity size for data items are:
- Overhead - the more granular the more objects and methods in supporting code,
- Industry practice - your granularity should generally match that of cloud and third-party
products if your system will be integrating with these services. For example, do not
combine first and last name as a single data item if every one else manages these as two
separate data items.
2. How different is a livelock from a deadlock? How can livelocks be mitigated in a database
A Livelock is a situation where a request for an exclusive lock is denied repeatedly, as many
overlapping shared locks keep on interfering each other. The processes keep on changing their
status, which further prevents them from completing the task. This further prevents them from
completing the task.
A livelock is similar to a deadlock, except that the states of the processes involved in the livelock
constantly change with regard to one another, none progressing.