0% found this document useful (0 votes)
32 views4 pages

Q11

Serializability ensures that a schedule with concurrent transactions is equivalent to one with serial transactions. It checks that transactions execute without interfering with each other to maintain database consistency. A serializable schedule can be converted to an equivalent serial schedule that executes transactions one at a time, while a non-serial schedule interleaves transactions and may affect consistency if they access the same data concurrently. Testing serializability involves building a serialization graph to identify conflicting operations between transactions that access the same data, one of which writes to it.

Uploaded by

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

Q11

Serializability ensures that a schedule with concurrent transactions is equivalent to one with serial transactions. It checks that transactions execute without interfering with each other to maintain database consistency. A serializable schedule can be converted to an equivalent serial schedule that executes transactions one at a time, while a non-serial schedule interleaves transactions and may affect consistency if they access the same data concurrently. Testing serializability involves building a serialization graph to identify conflicting operations between transactions that access the same data, one of which writes to it.

Uploaded by

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

What is Serializability?

Serializability of schedules ensures that a non-serial schedule is


equivalent to a serial schedule. It helps in maintaining the transactions to
execute simultaneously without interleaving one another. In simple
words, serializability is a way to check if the execution of two or more
transactions are maintaining the database consistency or not.

Schedules in DBMS are of two types:

1. Serial Schedule - A schedule in which only one transaction is


executed at a time, i.e., one transaction is executed completely
before starting another transaction.
2. Example:

Transaction-1 Transaction-2
R(a)
W(a)
R(b)
W(b)
R(b)
W(b)
R(a)
W(a)
3. Here, we can see that Transaction-2 starts its execution after the
completion of Transaction-1.
4. Non-serial Schedule - A schedule in which the transactions are
interleaving or interchanging. There are several transactions
executing simultaneously as they are being used in performing real-
world database operations. These transactions may be working on
the same piece of data. Hence, the serializability of non-serial
schedules is a major concern so that our database is consistent
before and after the execution of the transactions.
5. Example:

Transaction-1 Transaction-2
R(a)
W(a)
R(b)
W(b)
R(b)
R(a)
W(b)
W(a)

6. We can see that Transaction-2 starts its execution before the


completion of Transaction-1, and they are interchangeably working
on the same data, i.e., "a" and "b".

What is a serializable schedule?

A non-serial schedule is called a serializable schedule if it can be


converted to its equivalent serial schedule. In simple words, if a non-serial
schedule and a serial schedule result in the same then the non-serial
schedule is called a serializable schedule.

Testing of Serializability

To test the serializability of a schedule, we can use Serialization


Graph or Precedence Graph. A serialization Graph is nothing but a
Directed Graph of the entire transactions of a schedule.

It can be defined as a Graph G(V, E) consisting of a set of directed-edges E


= {E1, E2, E3, ..., En} and a set of vertices V = {V1, V2, V3, ...,Vn}. The set
of edges contains one of the two operations - READ, WRITE performed by
a certain
transaction.

Ti -> Tj, means Transaction-Ti is either performing read or write before


the transaction-Tj.

What is a conflicting pair in transactions?

Two operations inside a schedule are called conflicting if they meet these
three conditions:

1. They belong to two different transactions.


2. They are working on the same data piece.
3. One of them is performing the WRITE operation.

To conclude, let’s take two operations on data: "a". The conflicting pairs
are:

1. READ(a) - WRITE(a)
2. WRITE(a) - WRITE(a)
3. WRITE(a) - READ(a)

Let's take an example of schedule "S" having three transactions t1, t2,
and t3 working simultaneously, to get a better understanding.

t1 t2 t3
R(x)
R(z)
W(z)
R(y)
R(y)
W(y)
W(x)
W(z)
t1 t2 t3
W(x)

You might also like