DBMS slides 📂 Transactions and Concurrency · 4 of 5 34 min read

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

A schedule orders the operations of concurrent transactions — and its class decides what happens when one aborts. This tutorial covers serial vs non-serial schedules, dirty reads and cascading aborts, and the recoverability ladder: recoverable, cascadeless (ACA), and strict schedules. Includes the Serial ⊂ Strict ⊂ Cascadeless ⊂ Recoverable hierarchy, animated diagrams, and solved numericals.

Schedules & Recoverability

Serial, non-serial, recoverable, cascadeless, strict — the classes that decide what happens when a transaction aborts. Stop one failure from dragging others down with it.
Serial vs Non-Serial Recoverable Cascadeless (ACA) Strict

Press Next → or use ← → arrow keys

The Story

The Newsroom Retraction

Quoting a colleague before they've signed off
Reporter T1 writes a story with a quote. Editor T2 copies that quote into another piece before T1 has committed. Then T1's source retracts and T1 aborts — so T2's copy is now based on something that never officially existed, and T2 must abort too. That's a cascading abort.
📖
The Rule That Prevents It

"Nobody may quote a colleague until that colleague has officially signed off." In database terms: read only committed data. A schedule is simply an ordering of the reads, writes, commits and aborts of concurrent transactions.

Section 01

Serial vs Non-Serial Schedules

🧱
Serial
No interleaving — one transaction runs fully before the next begins. Always correct, but zero concurrency. For n transactions there are n! serial orders.
🔀
Non-serial
Operations of two or more transactions interleave. Faster — but not every interleaving is safe.
Serial (T1 then T2)
R1(A) W1(A) R1(B) W1(B) Commit1
R2(A) W2(A) R2(B) W2(B) Commit2
Non-serial — lost update
R1(A) R2(A) W1(A) W2(A) Commit1 Commit2

Both read the original A; T2's write overwrites T1's — T1's update is lost.

🪜
Quality Ladder of Non-Serial Schedules

Bad: non-serializable (anomalies) → Better: serializable (equals some serial) → Best: cascadeless (serializable + one abort never forces others).

Section 02

The Cascading Abort Problem

A dirty read is reading a value another transaction wrote but hasn't committed. If that writer aborts, the reader's work is invalid — and the failure cascades.

T1 ABORTSthe trigger T2 forced abortread dirty from T1 T3 forced abortread dirty from T2 …
💥
The Production Cost

Cascading aborts amplify the cost of any single failure — one timeout on one query can force dozens of unrelated transactions to roll back. This is an operational disaster, not a theoretical curiosity.

Section 03

Recoverable Schedules

📖
Definition

A schedule is recoverable if a transaction Tj commits only after every transaction Ti it read from has already committed. You never commit on top of data that might still be undone.

🚫
Irrecoverable
Tj reads from Ti and commits before Ti does. If Ti then aborts, Tj's commit can't be undone — the database is left inconsistent and unrecoverable.
✅
Recoverable
Tj waits for Ti's commit before committing itself. If Ti aborts first, Tj can still be rolled back cleanly — no committed lie survives.
⚠️
Recoverable Still Allows Dirty Reads

Recoverability only fixes commit order — it still permits reading uncommitted data, so cascading aborts are still possible. To stop those, we need a stricter class: cascadeless.

Section 04

Cascadeless Schedules (ACA)

📐
The Rule

Every transaction reads only committed values. Formally, whenever Tj reads X written by Ti, the commit of Ti comes first: Wi(X) → Commit(Ti) → Rj(X). Also called ACA — Avoids Cascading Aborts.

❌ Cascading S1
tT1T2
t1R(A)
t2W(A)
t3R(A)
t4W(A)
t5Abort
t6forced abort
✅ Cascadeless S2
tT1T2
t1R(A)
t2W(A)
t3Commit
t4R(A)
t5W(A)
t6Commit
🎯
The Only Difference

S2 simply moves T1's Commit before T2's read. Now an abort by T1 cannot reach T2 — no cascade is possible.

Section 04 · Nuance

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.

tT1T2T3
t1–t2R(A) · W(A)
t3–t4R(B) · W(B)
t5Commit
t6R(A) ← after Commit1
t7–t8W(C) · Commit
t9–t10W(A) · Commit
✅
Cascadeless AND Genuinely Concurrent

The only cross-transaction read — R3(A) at t6 — happens after Commit1 at t5. Meanwhile T2 and T3 overlap freely around t6–t8. Cascadelessness forbids dirty reads, not concurrency.

Section 05

Strict Schedules — The Strongest

🛡️
Definition

A schedule is strict if no transaction may read OR write an item X until every earlier transaction that wrote X has committed or aborted. It restricts not just reads (like cascadeless) but writes too.

🔒
What it adds over cascadeless
Cascadeless blocks only dirty reads. Strict also blocks writing over uncommitted data, which makes rollback trivial — just restore the pre-image.
⚙️
How it's enforced
Most production databases produce strict schedules via Strict Two-Phase Locking (SS2PL) — locks are held until commit.
↩️
Why Strict Matters for Recovery

Because no one touches X until its writer finishes, undoing an aborted transaction is a clean, local operation — the strongest recovery guarantee short of running serially.

Section 06

The Recoverability Hierarchy

All schedules Recoverable Cascadeless (ACA) Strict Serial
🪜
Serial ⊂ Strict ⊂ Cascadeless ⊂ Recoverable ⊂ All

Each inner class is a stricter promise than the one around it — and membership in an inner class automatically grants every outer-class guarantee. Serial is safest but slowest; recoverable is the loosest that's still safe to undo.

Section 06 · Compare

The Classes Side by Side

ClassGuaranteeCost
SerialNo interleaving — trivially safeZero concurrency
StrictNo read/write of X until earlier writers commit/abortMost blocking
CascadelessReads only committed data — no cascading abortsSome blocking on reads
RecoverableTj commits only after every Ti it read from commitsAllows dirty reads; cascades possible
OtherNo guarantees — unrecoverableNever allow
🏭
The Industry Default

Almost every engine (PostgreSQL, MySQL/InnoDB, SQL Server, Oracle) produces at least cascadeless schedules at any normal isolation level. Only READ UNCOMMITTED — where even allowed — lets dirty reads and cascading aborts appear.

Numerical 1

Identify the Schedule Type

ScheduleType
R1(X) W1(X) Commit1 R2(X) W2(X) Commit2Serial (also cascadeless & strict)
R1(X) W1(X) R2(X) W2(X) Commit1 Commit2Non-serial, NOT cascadeless — T2 dirty-reads X at step 3
R1(X) W1(X) Commit1 R2(X) W2(X) Commit2Cascadeless (T1 commits before T2 reads)
R1(X) R2(Y) W1(X) Commit1 W2(Y) R2(X) Commit2Non-serial AND cascadeless — R2(X) at step 6 is after Commit1
🔍
The Mechanical Test

Find every cross-transaction read of an item. If each one happens after the writer's Commit → cascadeless. If even one reads uncommitted data → not.

Numerical 2

Fix a Cascading Schedule

❌ Cascading (original)
R1(A) W1(A)
R2(A) W2(A)
R3(A) W3(A)
Commit1 Commit2 Commit3

T2 reads A written by T1 before Commit1; T3 reads A written by T2 before Commit2 — two dirty reads.

✅ Cascadeless (fixed)
R1(A) W1(A) Commit1
R2(A) W2(A) Commit2
R3(A) W3(A) Commit3

Each writer commits before the next reads A. Cascadeless (here, also serial).

🔧
The Minimal Fix

Move each writer's Commit before the next transaction's read of the same item. No other change is usually needed to remove every cascade.

Perspective

Academic vs Industry Lenses

🎓
Academic lens
Formal definitions and the class hierarchy. Typical ask: "Is this schedule cascadeless / recoverable / strict?" Tools: time-ordered operation lists and precedence graphs. Insight: the inclusion relationships.
🏭
Industry lens
Throughput without production pain. Default: strict via SS2PL or MVCC + commit visibility. Payoff: no cascading aborts → predictable latency. Advice: trust the default isolation; don't read uncommitted data unless you know exactly why.
🎯
The Practical Takeaway

Cascadelessness costs a little read-blocking but buys predictable recovery. That trade is almost always worth it — which is why every mainstream engine makes it the default.

Concept Check

Rapid-Fire Concept Check

ConceptAnswer
Schedule with no interleavingSerial
Serial schedules for n transactionsn!
One transaction's abort forces othersCascading
Cascadeless ruleRead only committed data
Alternative term for cascadelessACA (Avoids Cascading Aborts)
Uncommitted read termDirty read
Restricts both reads and writes to committedStrict
Strict implies → cascadeless implies →Recoverable
Protocol producing strict schedulesSS2PL (Strict 2PL)
Isolation level allowing cascading abortsREAD UNCOMMITTED
Golden Rules

Golden Rules of Schedules

🏆 NON-NEGOTIABLE PRINCIPLES
1
Serial = no operation of one transaction sits between two of another — a pure visual check.
2
Non-serial schedules interleave — test serializability and cascadelessness independently.
3
Cascadeless ⇔ every cross-transaction read happens after the writer's commit. Mechanical test.
4
Cascadeless ≠ serial — transactions on different items can run fully concurrently and stay cascadeless.
5
Serial ⊂ Strict ⊂ Cascadeless ⊂ Recoverable. Inner membership grants outer guarantees.
6
The minimal fix for a cascade: insert the writer's Commit before any other transaction reads that item.
FINAL

Read Only What's Signed Off

n!Serial orders
4Safety classes
ACANo cascades
SS2PLEnforces strict
🎯
The Whole Idea

A schedule's safety on abort is a ladder: recoverable fixes commit order, cascadeless forbids dirty reads so one abort never drags others down, and strict forbids touching uncommitted data at all — making rollback trivial. The fix for a cascade is always the same: commit the writer before anyone else reads it.

🧠
One Sentence to Remember

Read only committed data and you're cascadeless; that one habit turns a domino of aborts into a single, contained rollback.

🧾 End of tutorial · Press ← to review, or click Restart