DBMS 📂 Transactions and Concurrency: · 5 of 6 29 min read

Schedules in DBMS: Serial, Non-Serial, and Cascadeless Schedules

A comprehensive tutorial on DBMS schedules covering serial schedules (safe but slow, n! orderings), non-serial interleaved schedules (fast but anomaly-prone), and cascadeless schedules (which prevent cascading aborts by allowing reads only of already-committed data).

Section 01

The Story That Explains Schedules

The Newsroom at 11 PM
It is half an hour before the paper goes to print. Reporter T1 is finishing a breaking story and types a quote from a source. Editor T2, in a hurry, immediately copies that quote into a related editorial. Five minutes later, T1's source retracts — the quote is fake. T1 erases their story (a rollback).

Now T2 is in trouble. Their editorial contains a quote that no longer exists. T2 has to also erase their work. If a third writer T3 used T2's draft, they too must roll back. One bad source triggers a chain of forced retractions. This is the cascading abort problem.

A simple rule kills the chain: nobody is allowed to quote a colleague until that colleague has officially signed off on it. If T2 had waited until T1 committed their story, T2 would be safe. In databases, that rule is what makes a schedule cascadeless.

A schedule is an ordering of the operations (reads, writes, commits, aborts) of one or more concurrent transactions. The order matters: it decides what each transaction sees, what it produces, and how badly things break when one of them fails. This tutorial covers the three foundational schedule types you will be asked about — Serial, Non-Serial, and Cascadeless — plus where they sit in the wider hierarchy.


Section 02

Serial Schedules — Safe but Slow

A serial schedule is one in which the operations of different transactions are not interleaved. One transaction executes from start to commit before the next one begins. With n transactions there are exactly n! possible serial schedules.

Example: Serial Schedule (T1 then T2)
R1(A), W1(A), R1(B), W1(B), Commit1, R2(A), W2(A), R2(B), W2(B), Commit2
Serial vs Non-Serial Timeline
SERIAL NON-SERIAL T1 (complete) T2 (complete) T1 T2 T1 T2 T1 T2 T1 time →

Serial: each transaction runs to completion before the next starts. Non-Serial: operations of T1 and T2 are interleaved — faster, but only correct if the interleaving is well-chosen.

Always Correct
No interleaving = no anomalies
Each transaction sees the database in a clean, fully-committed state. No lost updates, dirty reads, or cascading aborts are even possible.
🕔
Slow in Practice
No concurrency
The CPU sits idle while a transaction waits for I/O. Throughput is dramatically lower than a well-designed concurrent system — often by an order of magnitude.
🎯
The Gold Standard
Used as the reference
Every other "safe" schedule must produce the same result as some serial schedule. Serial schedules are the yardstick of correctness, not the goal of execution.

Section 03

Non-Serial Schedules — Fast but Risky

A non-serial schedule interleaves the operations of two or more transactions in time. They are faster because the CPU and disk can work on multiple transactions in parallel — but not every interleaving is safe. Only some non-serial schedules are equivalent to a serial one (those are the serializable ones; the rest produce anomalies).

Example: Non-Serial Schedule
R1(A), R2(A), W1(A), W2(A), Commit1, Commit2
TimeTransaction 1Transaction 2
t1R(A)
t2R(A)
t3W(A)
t4W(A)
t5Commit
t6Commit
⚠️
The Lost Update Anomaly

In the table above, both T1 and T2 read the original value of A, compute updates separately, then write back. T2's write overwrites T1's. T1's update is lost. This is a non-serial schedule that is not serializable — a textbook example of the kind of interleaving the DBMS must prevent.

🧮 The Quality Ladder of Non-Serial Schedules
Bad
Non-serializable — produces anomalies that no serial schedule would. The DBMS must prevent these.
Better
Serializable — effect equals some serial schedule. Safe data-wise, but recovery from failures might still cascade.
Best
Cascadeless — serializable and a single abort never forces other transactions to abort. This is what we want in production.

Section 04

The Cascading Abort Problem

Imagine T2 reads a value that T1 has written but not yet committed. This is called a dirty read. If T1 later aborts, every byte T1 wrote must be undone — and T2's read becomes invalid. T2 must abort too. If T3 read from T2, T3 must also abort. One failure cascades into many.

Cascading Abort — The Domino Effect
T1 ABORTS 💥 read dirty T2 forced abort read dirty T3 forced abort Cascadeless schedules forbid this: T1 commits wait, then read T2 safe T3 safe No dominoes fall. Aborts stay local.

Top row: T1 aborts → T2 and T3 are forced to abort because they read uncommitted values. Bottom row: in a cascadeless schedule, T2 and T3 wait for T1 to commit, so an abort cannot cascade.

🔥
Why This Hurts in Production

Cascading aborts amplify the cost of any single failure. A timeout on one query can force dozens of unrelated transactions to roll back. The work is wasted, the user-visible latency spikes, and the lock manager thrashes. In a high-throughput system this is unacceptable — which is why every real engine guarantees at least cascadeless schedules.


Section 05

Cascadeless Schedules

A schedule is cascadeless (sometimes written ACA — Avoids Cascading Aborts) if every transaction reads only values that have been written by already-committed transactions.

📝
Formal Definition

A schedule S is cascadeless if, whenever a transaction Tj reads a value of X written by Ti (where i ≠ j), the commit of Ti precedes the read by Tj. In symbols: Wi(X) → Commit(Ti) → Rj(X).

Example — Comparing Cascading vs Cascadeless

❌ Cascading Schedule S1
TimeT1T2
t1R(A)
t2W(A)
t3R(A)
t4W(A)
t5Abort
t6forced abort
✅ Cascadeless Schedule S2
TimeT1T2
t1R(A)
t2W(A)
t3Commit
t4R(A)
t5W(A)
t6Commit

The only difference: in S2, T1's Commit at t3 happens before T2's R(A) at t4. That one ordering constraint is enough to kill the cascading abort problem entirely.


Section 06

The Full Schedule Hierarchy

The schedule classes nest inside each other like Russian dolls. Each inner class is a stricter promise than the one around it.

Schedule Class Hierarchy
All Schedules (incl. unsafe) Recoverable Cascadeless (ACA) Strict Serial

Serial ⊂ Strict ⊂ Cascadeless ⊂ Recoverable ⊂ All Schedules. Every serial schedule is strict, every strict schedule is cascadeless, and so on.

ClassGuaranteeCost
SerialNo interleaving at all — trivially safeZero concurrency — too slow
StrictNo read OR write of X until all earlier writers of X have committed/abortedMost blocking
CascadelessReads only see committed data — no cascading abortsSome blocking on reads
RecoverableTj commits only after every Ti it read from has committedAllows dirty reads — cascading aborts still possible
OtherNo guarantees — may be unrecoverableShould never be allowed by a DBMS
💡
The Practical Sweet Spot

Most production databases enforce strict schedules via Strict Two-Phase Locking (SS2PL): locks are held until commit, which means no read or write of an item can happen while another transaction has it — preventing both cascading aborts and many other anomalies. Strict implies cascadeless implies recoverable, so SS2PL gives all three guarantees with one mechanism.


Section 07

Numerical 1 — Identify the Schedule Type

Problem: Classify each schedule below as Serial, Non-Serial (cascading), or Cascadeless. Justify your choice.

Schedule A

Schedule A
R1(X), W1(X), Commit1, R2(X), W2(X), Commit2
✅ Solution
Type
Serial. T1 runs to completion (including Commit) before T2 begins any operation. No interleaving exists.
Also
Trivially cascadeless and strict, since serial is the strictest class.

Schedule B

Schedule B
R1(X), W1(X), R2(X), W2(X), Commit1, Commit2
✅ Solution
Type
Non-Serial, NOT cascadeless. T2 reads X at step 3, but at that moment T1 has written X (at step 2) and has not yet committed (Commit1 is at step 5). This is a dirty read.
Risk
If T1 aborts, T2 must also abort → cascading abort possible.

Schedule C

Schedule C
R1(X), W1(X), Commit1, R2(X), W2(X), Commit2
✅ Solution
Type
Cascadeless (and actually serial). T1 commits at step 3, before any operation of T2 begins. T2 reads only committed data.

Schedule D

Schedule D
R1(X), R2(Y), W1(X), Commit1, W2(Y), R2(X), Commit2
✅ Solution
Interleaving?
Yes — operations of T1 and T2 alternate at the start.
Dirty read?
The only cross-transaction read is R2(X) at the end. T1 wrote X at step 3 and committed at step 4. R2(X) happens at step 6 — after Commit1.
Type
Non-Serial AND Cascadeless. Interleaved but every cross-transaction read sees committed data only.

Section 08

Numerical 2 — Fix a Cascading Schedule

Problem: Schedule S below allows a cascading abort. Modify it minimally to make it cascadeless.

Original Schedule S (cascading)
R1(A), W1(A), R2(A), W2(A), R3(A), W3(A), Commit1, Commit2, Commit3
🧮 Analysis
Issue 1
T2 reads A at step 3 — written by T1 at step 2 — but T1 commits only at step 7. Dirty read by T2.
Issue 2
T3 reads A at step 5 — written by T2 at step 4 — but T2 commits at step 8. Dirty read by T3.
Fix
Move each Commit before the next transaction's read of the same item.
Fixed Cascadeless Schedule S'
R1(A), W1(A), Commit1, R2(A), W2(A), Commit2, R3(A), W3(A), Commit3
Verdict

The fixed schedule is cascadeless — in fact it is also serial. In this particular problem (each transaction reads what the previous one wrote), avoiding cascading aborts forces serial execution. In schedules where transactions touch different items, cascadelessness can coexist with significant concurrency.


Section 09

Numerical 3 — Mixed Items, Real Concurrency

Problem: Determine whether Schedule T is cascadeless, given:

Schedule T
R1(A), W1(A), R2(B), W2(B), Commit1, R3(A), W2(C), Commit2, W3(A), Commit3
TimeT1T2T3
t1R(A)
t2W(A)
t3R(B)
t4W(B)
t5Commit
t6R(A)
t7W(C)
t8Commit
t9W(A)
t10Commit
🧮 Check Each Cross-Transaction Read
R3(A) @t6
Reads A. Last writer of A before t6 is T1 (W1(A) @t2). T1 committed at t5 — before t6. ✓ Reading committed data.
Others
T2 reads only B, which only T2 ever touches. T1 reads only A initially (no prior writer in the schedule). No other cross-transaction reads exist.
Verdict — Cascadeless and Genuinely Concurrent

Every cross-transaction read happens after the relevant writer has committed. The schedule is cascadeless. Notice that T2 and T3 are actually running concurrently around t6–t8 — cascadelessness does not forbid concurrency, it only forbids reading uncommitted data.


Section 10

Academic View vs Industry View

🎓 Academic Lens
AspectDetail
FocusFormal definitions and class hierarchy
GoalProve a schedule belongs to a class
ToolsTime-ordered operation lists, precedence graphs
Common ask"Is this schedule cascadeless / recoverable / strict?"
InsightHierarchy: Serial ⊂ Strict ⊂ Cascadeless ⊂ Recoverable
🏭 Industry Lens
AspectDetail
FocusThroughput while avoiding production pain
DefaultStrict via SS2PL or MVCC + commit visibility
Cost savedNo cascading aborts → predictable latency
Trade-offLocks held longer → some throughput loss vs weaker levels
Practical adviceTrust the default isolation; don't read uncommitted data unless you know exactly why
📊
Where Real Databases Sit

Almost every mainstream engine (PostgreSQL, MySQL/InnoDB, SQL Server, Oracle) produces at least cascadeless schedules at any normal isolation level. The READ UNCOMMITTED level (where allowed at all) is the only place dirty reads — and therefore potential cascading aborts — can appear. It exists mostly for read-only reporting where occasional dirty data is acceptable.


Section 11

Rapid-Fire Concept Check

QuestionAnswer
Schedule with no interleaving of operationsSerial
Number of serial schedules for n transactionsn!
A schedule where one transaction's abort forces others to abortCascading
The rule that defines cascadeless schedulesRead only committed data
Alternative name for cascadelessACA (Avoids Cascading Aborts)
A read of an uncommitted write is calledDirty read
Class containing both reads and writes restricted to committed dataStrict
Strict implies cascadeless implies…Recoverable
Protocol that produces strict schedulesSS2PL (Strict 2PL)
Isolation level that allows cascading abortsRead Uncommitted

Section 12

Golden Rules

📚 Serial, Non-Serial & Cascadeless — Non-Negotiable Rules
1
A schedule is serial if and only if no operation of one transaction sits between two operations of another. Spotting this is purely a visual check on the schedule table.
2
A non-serial schedule has interleaved operations. It may or may not be serializable, and may or may not be cascadeless — check each property independently.
3
A schedule is cascadeless if and only if every cross-transaction read happens after the writer's commit. The test is mechanical: list cross-transaction reads, check the commit point of the writer.
4
Cascadeless does not mean serial. Two transactions touching different items can run fully concurrently and still be cascadeless. The restriction is only on reading uncommitted data.
5
The inclusion order is Serial ⊂ Strict ⊂ Cascadeless ⊂ Recoverable. Belonging to an inner class automatically gives all outer-class guarantees.
6
Cascading aborts are an operational disaster, not just a theoretical curiosity: one failure can roll back a chain of unrelated work. Every production database enforces cascadelessness or stricter by default.
7
If an exam question asks "make this schedule cascadeless", the minimal fix is to insert a Commit by the writer before any other transaction's read of the same item. No other change is usually needed.