0% found this document useful (0 votes)
36 views1 page

Database Concurrency Assignment

Livelocks can be mitigated in databases by: - Using finer-grained locking to reduce overlapping locks - Implementing timeouts so processes will abort if they cannot acquire a lock within a certain time period - Prioritizing lock requests to avoid indefinite waiting and reduce thrashing between processes

Uploaded by

elly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views1 page

Database Concurrency Assignment

Livelocks can be mitigated in databases by: - Using finer-grained locking to reduce overlapping locks - Implementing timeouts so processes will abort if they cannot acquire a lock within a certain time period - Prioritizing lock requests to avoid indefinite waiting and reduce thrashing between processes

Uploaded by

elly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Elly Mungai

BSCIT-01-0387/2019

Database Concurrency and Security


1. How does the granularity of data items affect the performance of concurrency
control? What factors affect selection of granularity size for data items?

- 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,

- Regulatory - there may be compliance mandates specifying what granularity will be


maintained in the data,

- 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.

You might also like