Conflict Serializability and Precedence Graphs
Build ordering edges from conflicting accesses and use a graph cycle to certify that no conflict-equivalent serial order exists.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Two operations conflict if their order can affect a shared item
For separate transactions, a read and a write of the same item conflict, as do two writes. Two reads do not. For each conflicting pair in the schedule, draw an edge from the earlier transaction to the later one. A topological ordering of the graph gives a serial schedule with the same conflicting orders. An ordering cycle prevents any such serial schedule.
Two independent writes can still create a cycle
Let transaction one read \(y\), transaction two read \(x\), then one write \(x\) and two write \(y\). The read of \(x\) requires two before one, and the read of \(y\) requires one before two. Their writes target different items, yet the graph cycles. Topological ordering explains the witness criterion. Two-phase locking prevents such conflict cycles under its locking model.[1][2]