LightMySky
En anglais

Transactions and the ACID Promise

A transaction groups statements so they take effect together or not at all, keep the database's rules true, do not see each other half-done, and survive a crash once committed. Those four promises are what let application code stay simple.

Commence ce sujetPas besoin de compte. La progression est enregistrée dans ce navigateur.

Ce que l'enfant saura faire ensuite

  • State each of the four properties in terms of what a failure would otherwise leave behind
  • Identify a sequence of statements that has to be one transaction
  • Explain what rollback restores and what it cannot undo

1 · Lis

A transaction is a bundle of steps the database runs together. Atomicity means all or nothing: either every step happens or none do, so money never leaves one account without arriving in the other.

Consistency means each transaction moves the database from one valid state to another, never breaking rules like a balance never dropping below zero. Isolation means concurrent transactions never see each other half done, as if each ran alone.

Try it together

Durability means committed work survives even a crash right after, because the database keeps a log it can replay. Rollback is the undo button for a transaction that cannot finish: it wipes partial steps and restores the last valid state. It cannot reach work already committed, and it cannot recall anything that has left the database, like a confirmation email already sent.

Group statements that must stand together into one transaction, such as debit plus credit in a transfer. The database then handles the hard parts: no partial updates, no broken rules, no mixed overlaps, and no lost work.

Bundle related steps, and atomicity, consistency, isolation, and durability cover the failures for you.

The rewritten reading was written for this dataset.

2 · Regarde

En anglais

Sans écran

Imprimer une fiche d'exercicesFormat A4, avec une page de corrigés pour les adultes. Sans écran, sans internet.

Où se situe ce sujet

Puis s'entraîner

8 questions attendent derrière cette leçon, chacune avec sa réponse expliquée. Chaque réponse nourrit le ciel : les étoiles s'allument à mesure qu'elles sont apprises, et pâlissent quand vient le moment de revenir.

Commence ce sujet