An interactive explainer

Both transactions were right. The Ledger is still short 500.

A transaction is one piece of work the database treats as a single unit. It does not stop other people from working. It only promises what that work is allowed to see. The promise most databases give you by default is weak enough that two correct transfers can lose money.

Database transactions · Isolation levels · Lost update · Write skew

Databases & Search · Intermediate · 9 min · Why two correct transfers can lose money — an interactive explainer on ViLearn, with a simulation and a knowledge check. All explainers.

Related: How a database finds one row in a million · What a queue really does when you are overloaded · Jury duty for servers