DATABASE MANAGEMENT SYSTEMS/Student Engineering Notebook
Page 07·notes
TRANSACTIONS & CONCURRENCY CONTROL—~28 MIN READ

ACID Invariants, Precedence Graphs & Conflict Serializability

“ACID, conflicting operations, precedence graphs, cycles, and recoverability classes.”

1.The Chaos of Interleaved Executions

When thousands of users execute bank transfers simultaneously, executing them sequentially one-by-one destroys throughput. But interleaving their operations blindly causes Lost Updates, Dirty Reads, and Inconsistent Summaries.

A Transaction is a logical unit of database processing that includes one or more database access operations. To maintain database consistency amidst failures and concurrency, the DBMS must guarantee the famous ACID Properties:

• Atomicity: All-or-nothing execution. Managed by the recovery log (Undo mechanism).

• Consistency: Database transitions from one valid state satisfying all integrity constraints to another valid state.

• Isolation: Concurrently executing transactions are shielded from each other's uncommitted intermediate states. Managed by the Concurrency Control Manager.

• Durability: Once a transaction commits, its updates persist permanently even if the power fails 1 millisecond later. Managed by Write-Ahead Logging (Redo mechanism).

2.Conflict Serializability & Precedence Graphs

A schedule is Conflict Serializable if it is conflict-equivalent to some serial execution of the same transactions.

What Constitutes a Conflicting Operation?

Two operations I_i and I_j belonging to different transactions are in conflict if and only if:

1. They belong to different transactions (T_i ≠ T_j),

2. They access the exact same data item X,

3. At least one of them is a WRITE (W(X)).

The Three Conflicting Pairs:

• R_i(X) and W_j(X) (Read-Write conflict / Anti-dependency)

• W_i(X) and R_j(X) (Write-Read conflict / Dirty Read hazard)

• W_i(X) and W_j(X) (Write-Write conflict / Blind Write hazard)

The Precedence Graph (Serialization Graph) Test:

1. Create a node for each participating transaction T_i.

2. Draw a directed edge T_i → T_j if T_i executes a conflicting operation on item X before T_j executes its conflicting operation on X.

3. Theorem: A schedule is Conflict Serializable IF AND ONLY IF its precedence graph contains NO DIRECTED CYCLES (is a DAG).

4. If acyclic, the Topological Sort of the graph yields the exact equivalent serial schedule!

LABORATORY · INTERACTIVE SIMULATION —Concept Exploration

3. Interactive Precedence Graph & Serializability Checker

Select classic GATE schedule presets or test your own interleaved operations. The simulator automatically identifies conflicting pairs, builds the directed precedence graph, detects cycles, and derives the equivalent serial schedule.

Interactive Concurrency Simulator

Precedence Graph & Conflict Serializability Engine

Identifies conflicting operations and tests precedence graphs for directed cycles.

● Non-Serializable (Cycle Detected)
Select Exam Scenario Preset:
Interleaved Execution Sequence:4 sequential operations
t=1R1(X)
→
t=2R2(X)
→
t=3W1(X)
→
t=4W2(X)

Precedence Graph (Serialization Graph)

2 Directed Edges
T1
T2
T1 → T2T2 → T1

⚠️ Precedence Graph Contains a Directed Cycle: There is a cyclic dependency between T2 and T1. No serial schedule can preserve the conflict order. Hence, this schedule is NOT Conflict Serializable.

Detected Conflicting Operations

3 conflict pairs
R1(X)prior toW2(X)Item: X · Read-Write (Anti-dependency)
T1 → T2
R2(X)prior toW1(X)Item: X · Read-Write (Anti-dependency)
T2 → T1
W1(X)prior toW2(X)Item: X · Write-Write (Blind Write clash)
T1 → T2

4.Schedule Recoverability Hierarchy

Serializability guarantees correctness, but recoverability guarantees that an unexpected crash will not leave the database in an unrecoverable corrupted state.

1. Recoverable Schedule: If transaction T_j reads a value written by T_i, then T_i must commit BEFORE T_j commits.

Why: If T_j commits first and T_i aborts, T_j committed invalid dirty data that cannot be rolled back!

2. Cascadeless Schedule (Avoids Cascading Aborts): If T_j reads a value written by T_i, then T_i must commit BEFORE T_j even performs its READ.

Why: Prevents domino-effect aborts where aborting T_1 forces 50 downstream transactions to be cancelled.

3. Strict Schedule: If T_j wants to Read OR Write an item written by T_i, T_i must commit or abort first.

The Universal Schedule Subset Hierarchy: All Schedules ⊃ Recoverable ⊃ Cascadeless ⊃ Strict.

STUDENT PRACTICE · CONCEPT DRILL

5. Serializability & Concurrency Quiz

Solve classic GATE questions on serializability and schedules.

Problem 1 · FOUNDATION

Consider schedule S: r1(X); r2(X); w1(X); w2(X). Which of the following is true?

RAPID REVIEW · NOTEBOOK SUMMARY

6. 1-Minute Concurrency Revision Card

core principle:

“Conflicting pair = Same item, different tx, AT LEAST ONE WRITE. Cycle in precedence graph = NOT Conflict Serializable.”

must-remember principles:
  • •Precedence Graph: Ti → Tj if Ti does conflicting op before Tj.
  • •Acyclic graph? Topological sort gives equivalent serial schedule!
  • •Recoverable: Ti commits before Tj commits (where Tj reads from Ti).
  • •Cascadeless: Ti commits before Tj READS from Ti.
  • •Strict: Ti commits before Tj reads OR writes X.
critical exam pitfalls:
  • •Two READ operations on the same data item never conflict with each other.
  • •A schedule can be conflict serializable but still non-recoverable!
SOURCE TRANSPARENCY & CITATIONS

Primary Academic References & Exam Sources

Every concept in Notes From a B.Tech Brain is synthesized from authoritative academic texts, seminal peer-reviewed research, verified exam archives, and renowned university lectures.

Primary Academic Texts
The Notions of Consistency and Predicate Locks in a Database System↗by K. P. Eswaran, J. N. Gray, R. A. Lorie, I. L. Traiger (CACM 1976) · The founding paper on serializability theory and Two-Phase Locking

Turing Award-winning paper that mathematically proved conflict serializability theorems.

ACADEMIC STANDARD
Database System Concepts (10th Edition)↗by Silberschatz, Korth, Sudarshan · Chapter 17: Transactions & Concurrency Control

Standard reference for precedence graph construction and recoverability definitions.

ACADEMIC STANDARD
RECOMMENDED YOUTUBE EDUCATORS & FULL-COURSE PLAYLISTS

Curated for clarity, rigorous numerical solving, and semester excellence:

Knowledge Gate · DBMS for GATE & Semester↗Instructor: Sanchit Jain · Covers: ER diagrams, normalization, SQL, transactions, concurrency control

GATE-focused numerical problem-solving with clear worked examples.

Open YouTube↗
Gate Smashers · DBMS Full Course↗Instructor: Varun Singla · Covers: Relational algebra, SQL queries, B/B+ trees, file organization

Fast conceptual coverage with step-by-step GATE numericals.

Open YouTube↗
Neso Academy · DBMS Complete Playlist↗Instructor: Neso Academy · Covers: Relational model, SQL, normalization theory, ACID properties

Systematic textbook-style explanations ideal for first-time learners.

Open YouTube↗
Ravindrababu Ravula · DBMS Lectures↗Instructor: Ravindrababu Ravula · Covers: Functional dependencies, BCNF, 3NF decomposition, transaction schedules

Deep theoretical rigor on normalization and transaction serializability.

Open YouTube↗