0% found this document useful (0 votes)
143 views

Assignment 2

This document contains two questions regarding database concepts. [1] It defines serializability as scheduling transactions serially (one after another) to avoid inconsistencies, and provides an example comparing a serial versus non-serial schedule. [2] It explains that concurrency control is important to ensure data integrity when multiple users access a database simultaneously, and lists three specific problems (lost updates, dirty reads, incorrect summaries) that can occur without proper concurrency control.
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)
143 views

Assignment 2

This document contains two questions regarding database concepts. [1] It defines serializability as scheduling transactions serially (one after another) to avoid inconsistencies, and provides an example comparing a serial versus non-serial schedule. [2] It explains that concurrency control is important to ensure data integrity when multiple users access a database simultaneously, and lists three specific problems (lost updates, dirty reads, incorrect summaries) that can occur without proper concurrency control.
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/ 5

Assignment 2 (Marks : 5)

1) What is serializability. Explain it with the help of Examples.


2) What is the Importance of database concurrency control? Why concurency
control is important?
Answer Q1:
What is Serializability in DBMS?

Serial schedule both by definition and execution means that the transactions
bestowed upon it will take place serially, that is, one after the other. This leaves no
place for inconsistency within the database. But, when a set of transactions are
scheduled non-serially, they are interleaved leading to the problem of concurrency
within the database. Non-serial schedules do not wait for one transaction to
complete for the other one to begin. Serializability in DBMS decides if an
interleaved non-serial schedule is serializable or not.

Example of Serializability

Consider 2 schedules, Schedule1 and Schedule2:


1. Schedule1 is a serial schedule consisting of Transaction1 and Transaction2

wherein the operations on data item A (A1 and A2) are performed first and

later the operations on data item B (B1 and B2) are carried out serially.

2. Schedule2 is a non-serial schedule consisting of Transaction1 and Transaction2

wherein the operations are interleaved.

Explanation: In the given scenario, schedule2 is serializable if the output obtained

from both Schedule2 and Schedule1 are equivalent to one another In a nutshell, a

transaction within a given non-serial schedule is serializable if its outcome is

equivalent to the outcome of the same transaction when executed serially.

Answer Q2:
What is the importance of concurrency control?

Concurrency controls prevent data integrity problems, which can arise when two
update processes access the same data item at the same time. Access controls
restrict updating of the database to authorized users, and controls such as
passwords prevent the inadvertent or unauthorized disclosure of data from the
database.

Why is concurrency control needed?

To ensure data integrity when updates occur to the database in a multiuser


environment.

If transactions are executed serially, i.e., sequentially with no overlap in time, no


transaction concurrency exists. However, if concurrent transactions with
interleaving operations are allowed in an uncontrolled manner, some unexpected,
undesirable result may occur, such as:

1. The lost update problem:


A second transaction writes a second value of a data-item (datum) on top
of a first value written by a first concurrent transaction, and the first
value is lost to other transactions running concurrently which need, by
their precedence, to read the first value. The transactions that have read
the wrong value end with incorrect results.
2. The dirty read problem:
Transactions read a value written by a transaction that has been later
aborted. This value disappears from the database upon abort, and should
not have been read by any transaction (“dirty read”). The reading
transactions end with incorrect results.
3. The incorrect summary problem:
While one transaction takes a summary over the values of all the
instances of a repeated data-item, a second transaction updates some
instances of that data-item. The resulting summary does not reflect a
correct result for any (usually needed for correctness) precedence order
between the two transactions (if one is executed before the other), but
rather some random result, depending on the timing of the updates, and
whether certain update results have been included in the summary or
not.

You might also like