Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M7249

Transaction Rollback Logic

Transaction Rollback Logic
StructureHigh supportLogic
Included
account_tree

Updated 2026-08-10

Loading revision record…

Summary

When an operation fails, roll the system state back to where it started: all success, or all undone.

Definition

When an operation fails, the system state is restored to what it was before the operation began: either everything succeeds, or everything is undone. As a scaffold it is safe failure handling: you may attempt an operation that could fail, because the failure can be undone, which lowers the cost of trying it in the first place.

How to use

- Bundle up: put all of the related operations together inside one single transaction. - Old state saved: record exactly what the system looked like before you ever begin. - Any failure, full rewind: if any single step fails, undo the whole transaction at once.

Mechanism

This is the atomicity of ACID database transactions: a group of operations either all succeeds or fails and rolls back to the starting point. The mechanism is the undo log, which records the old value before the operation, so that an error can be reversed by applying it backward, making trial and error safe because failure can be undone.

Practice

In progress 0/1

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • A bank transfer is atomic: if the credit fails, the debit is rolled back too.
  • A code deployment rolls back to the prior version through a blue-green switch.
  • An experiment uses controls and a reversible design to cheapen each trial.

Common pitfalls

  • Forgetting that the rollback itself can fail, and never verifying it after.
  • Treating a reversible action as though it carried no cost at all.
  • Using the logic only in software, and never designing reversible decisions in life.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    en.wikipedia.orghttps://en.wikipedia.org/wiki/Rollback_(data_managementZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS