Introduction
When multiple transactions run at the same time in a database, their operations can mix up and cause wrong results. We need a way to check if the mixed operations still behave like some order of running transactions one after another.
Imagine two cooks sharing a kitchen. They both need to use the same knife and cutting board. If they take turns using these tools without interrupting each other, the cooking process is smooth and predictable. But if they try to use the knife at the same time, it causes confusion and mistakes.
┌─────────────┐ ┌─────────────┐
│ Transaction │─────▶ │ Transaction │
│ T1 │ │ T2 │
└─────────────┘ └─────────────┘
▲ │
│ ▼
┌─────────────┐ ┌─────────────┐
│ Transaction │◀───── │ Transaction │
│ T3 │ │ T4 │
└─────────────┘ └─────────────┘
If no cycles exist in this graph, the schedule is conflict serializable.