NIMCET, GATE, CUET & CBSE test series are live — start practicing free
syllabuzAI

Conflict and View Serializability in DBMS | GATE CSE

Learn conflicting operations, the precedence graph test for conflict serializability, view serializability and blind writes for GATE CSE DBMS, with worked examples.

7 min read

AS

Aman Singh

Updated 26 November 2026

On this page

Quick answer: A schedule is serializable if it is equivalent to some serial schedule. Two operations conflict when they come from different transactions, touch the same data item, and at least one is a write. A schedule is conflict serializable if and only if its precedence graph is acyclic, and each topological order of that graph is an equivalent serial order. A schedule is view serializable if some serial schedule has the same initial reads, the same reads-from relationships and the same final writes. Every conflict-serializable schedule is view serializable, and a schedule that is view serializable but not conflict serializable must contain a blind write.

Testing serializability is one of the most common transactions questions in GATE. This topic is part of the Transactions and Concurrency Control chapter.

Schedules

A schedule is the time-ordered sequence of operations from several transactions, with each transaction's own operations kept in their original order. Notation: R1(A) means T1 reads A, and W2(A) means T2 writes A.

Serial schedules

  • One transaction finishes before the next one starts.
  • n transactions give n! serial schedules.
  • They always give a consistent result but allow no concurrency, so throughput is low.

Concurrent (non-serial) schedules

  • Operations interleave, which improves throughput and response time but can give inconsistent results.
  • Two transactions with n and m operations have this many possible interleavings:

(n+m)!n! m!\frac{(n+m)!}{n!\,m!}

Conflicting operations

Two operations conflict only if all three conditions hold:

  • They come from different transactions.
  • They access the same data item.
  • At least one of them is a write.
Pair (same item, different transactions)Conflict?
Ri(A), Rj(A)No
Ri(A), Wj(A)Yes
Wi(A), Rj(A)Yes
Wi(A), Wj(A)Yes

Operations on different data items never conflict, even if both are writes.

Conflict equivalence and conflict serializability

  • Two schedules are conflict equivalent if one can be turned into the other by repeatedly swapping adjacent non-conflicting operations. Put another way, they order every conflicting pair the same way.
  • A schedule is conflict serializable if it is conflict equivalent to some serial schedule.

Precedence graph test

Step 1: Draw one node for each transaction.

Step 2: For every conflicting pair where Ti's operation comes first, add an edge Ti → Tj.

Step 3: The schedule is conflict serializable if and only if the graph has no cycle.

Step 4: Each topological order of the graph is an equivalent serial schedule. The number of conflict-equivalent serial schedules equals the number of topological orders.

Worked example 1: conflict serializable

S: R2(A), R2(B), W1(A), W2(B), W3(A), W3(B)

  • On A: R2(A) before W1(A) gives T2 → T1. R2(A) before W3(A) gives T2 → T3. W1(A) before W3(A) gives T1 → T3.
  • On B: R2(B) and W2(B) before W3(B) give T2 → T3.
  • Edges: T2 → T1, T2 → T3, T1 → T3. There is no cycle.
  • The only topological order is T2, T1, T3, so S is conflict equivalent to that serial schedule.

Worked example 2: counting serial orders

S: R1(A), W2(A), R3(B), W4(B)

The only edges are T1 → T2 and T3 → T4. The topological orders interleave two independent chains of length 2:

(42)=6\binom{4}{2} = 6

So there are 6 conflict-equivalent serial schedules.

Worked example 3: not serializable (lost update)

S: R1(A), R2(A), W1(A), W2(A)

  • R1(A) before W2(A) gives T1 → T2. R2(A) before W1(A) gives T2 → T1. That is a cycle, so S is not conflict serializable.
  • Both transactions read the initial A. In any serial order one of them would read the other's write, so S is not view serializable either. T1's update is lost.

View equivalence and view serializability

Two schedules over the same transactions are view equivalent if, for every data item A:

  • Initial read: if Ti reads the initial value of A in one schedule, it does so in the other.
  • Reads-from: if Ti reads a value of A written by Tj in one schedule, it reads the value written by Tj in the other.
  • Final write: the transaction that performs the last write on A is the same in both.

A schedule is view serializable if it is view equivalent to some serial schedule.

Worked example 4: view serializable but not conflict serializable

S: R1(A), W2(A), W1(A), W3(A)

  • Conflict test: R1(A) before W2(A) gives T1 → T2, and W2(A) before W1(A) gives T2 → T1. That is a cycle, so S is not conflict serializable.
  • View test against T1, T2, T3: T1 reads the initial A in both, there are no other reads, and T3 does the final write in both. So S is view serializable.
  • W2(A) and W3(A) write A without reading it first. These are blind writes.

How the classes relate

  • Conflict serializable ⇒ view serializable.
  • Not conflict serializable ⇒ may or may not be view serializable.
  • View serializable but not conflict serializable ⇒ the schedule has at least one blind write.
  • Testing conflict serializability takes polynomial time (cycle detection). Testing view serializability is NP-complete in general.

Summary table

CheckHow to test it
Conflicting pairDifferent transactions, same item, at least one write
Conflict serializablePrecedence graph is acyclic
Equivalent serial ordersTopological orders of the precedence graph
View serializableSame initial reads, reads-from and final writes as some serial schedule
View but not conflict serializableMust contain blind writes
Number of serial schedulesn! for n transactions

Exam tips

  • Always draw the precedence graph first. If it is acyclic, you are done.
  • If the graph has a cycle and there are no blind writes, the schedule is not view serializable either, so you can stop.
  • For "how many equivalent serial schedules", count topological orders rather than listing every permutation.

Common mistakes

  • Adding edges for read-read pairs or for operations on different items.
  • Drawing edges the wrong way. The transaction with the earlier operation points to the one with the later operation.
  • Saying "not serializable" just because of a cycle. The schedule may still be view serializable.
  • Forgetting blind writes when checking view serializability.

Practice questions

Q1. Is R1(A), W1(A), R2(A), W2(A), R1(B), W1(B) conflict serializable?

Answer: The only edge is T1 → T2 (on A; B is used only by T1). The graph is acyclic, so yes, and it is equivalent to T1, T2.

Q2. Is W1(A), W2(A), W2(B), W1(B) conflict serializable? Is it view serializable?

Answer: A gives T1 → T2 and B gives T2 → T1, a cycle, so it is not conflict serializable. The final write on A is by T2 (needs T1 before T2) and on B is by T1 (needs T2 before T1). No serial order satisfies both, so it is not view serializable.

Q3. Two transactions have 2 operations each. How many concurrent schedules are possible?

Answer:

4!2! 2!=6\frac{4!}{2!\,2!} = 6

FAQs

What is a conflict serializable schedule?

It is a schedule you can turn into a serial schedule by swapping adjacent non-conflicting operations. Its precedence graph has no cycle.

What is a blind write?

A blind write is a write to a data item by a transaction that did not read that item first.

Is every view serializable schedule conflict serializable?

No. Every conflict-serializable schedule is view serializable, but some view-serializable schedules with blind writes are not conflict serializable.

How do you draw a precedence graph?

Make a node for each transaction. For each conflicting pair, draw an edge from the transaction whose operation comes first to the one whose operation comes later.

How many serial schedules are possible for n transactions?

There are n! serial schedules, one for each ordering of the transactions.

Conclusion

Draw the precedence graph first. If it is acyclic, the topological orders give the serial schedules. If it has a cycle, look for blind writes and test the three view conditions. Continue with recoverable, cascadeless and strict schedules, or go back to the Transactions and Concurrency Control chapter.

Concept Check

EASY

Conflict serialization is NOT satisfied by –

Suggested for you