ACID Invariants, Precedence Graphs & Conflict Serializability
“ACID, conflicting operations, precedence graphs, cycles, and recoverability classes.”
1.The Chaos of Interleaved Executions
§ 7.1.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
§ 7.2.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!
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.
Precedence Graph & Conflict Serializability Engine
Identifies conflicting operations and tests precedence graphs for directed cycles.
Precedence Graph (Serialization Graph)
2 Directed Edges⚠️ 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 pairs4.Schedule Recoverability Hierarchy
§ 7.4.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.
5. Serializability & Concurrency Quiz
Solve classic GATE questions on serializability and schedules.
Consider schedule S: r1(X); r2(X); w1(X); w2(X). Which of the following is true?
6. 1-Minute Concurrency Revision Card
“Conflicting pair = Same item, different tx, AT LEAST ONE WRITE. Cycle in precedence graph = NOT Conflict Serializable.”
- •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.
- •Two READ operations on the same data item never conflict with each other.
- •A schedule can be conflict serializable but still non-recoverable!
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.
Turing Award-winning paper that mathematically proved conflict serializability theorems.
Standard reference for precedence graph construction and recoverability definitions.
Curated for clarity, rigorous numerical solving, and semester excellence:
GATE-focused numerical problem-solving with clear worked examples.
Fast conceptual coverage with step-by-step GATE numericals.
Systematic textbook-style explanations ideal for first-time learners.
Deep theoretical rigor on normalization and transaction serializability.