What is the term serializability in DBMS?

DBMSDatabaseBig Data Analytics

A schedule is serialized if it is equivalent to a serial schedule. A concurrent schedule must ensure it is the same as if executed serially means one after another. It refers to the sequence of actions such as read, write, abort, commit are performed in a serial manner.

Example

Let’s take two transactions T1 and T2,

If both transactions are performed without interfering each other then it is called as serial schedule, it can be represented as follows −

T1T2
READ1(A)
WRITE1(A)
READ1(B)
C1

READ2(B)

WRITE2(B)

READ2(B)

C2

Non serial schedule − When a transaction is overlapped between the transaction T1 and T2.

Example

Consider the following example −

T1T2
READ1(A)
WRITE1(A)

READ2(B)

WRITE2(B)
READ1(B)
WRITE1(B)
READ1(B)

Types of serializability

There are two types of serializability −

View serializability

A schedule is view-serializability if it is viewed equivalent to a serial schedule.

The rules it follows are as follows −

  • T1 is reading the initial value of A, then T2 also reads the initial value of A.

  • T1 is the reading value written by T2, then T2 also reads the value written by T1.

  • T1 is writing the final value, and then T2 also has the write operation as the final value.

Conflict serializability

It orders any conflicting operations in the same way as some serial execution. A pair of operations is said to conflict if they operate on the same data item and one of them is a write operation.

That means

  • Readi(x) readj(x) - non conflict  read-read operation

  • Readi(x) writej(x) - conflict       read-write operation.

  • Writei(x) readj(x) - conflict       write-read operation.

  • Writei(x) writej(x) - conflict      write-write operation.

raja
Published on 06-Jul-2021 14:05:01
Advertisements