It is Friday evening, and you send Tk 3,000 to your younger brother's mobile wallet for his hostel fees. You press "Confirm", the little circle spins, and at that exact second the network drops. Now you have a very real worry. Has the money left your account? Has it reached his? Could it have left yours and reached nobody?
On the same evening, thousands of other people are sending money through the same system, many of them touching the same accounts at the same moment. A shop owner's wallet may receive fifty payments in one minute. Somehow every one of those fifty payments has to land, none may be counted twice, and none may be lost.
The idea that makes all this safe is called a transaction, and this chapter is about it. Bank and BCS papers ask it constantly, from one-mark MCQs ("which ACID property is broken here?") to long written answers ("explain dirty read with an example", "test this schedule for serializability").
By the end of the chapter you'll be able to say exactly what a transaction is and trace it through its five states. You'll write COMMIT, ROLLBACK and SAVEPOINT and predict what the table looks like afterwards. You'll explain each ACID property with an example of what happens when it fails. You'll draw the classic concurrency problems (lost update, dirty read, incorrect summary, unrepeatable read and phantom) as timelines, decide whether a schedule is serializable with a precedence graph, tell recoverable, cascadeless and strict schedules apart, and pick an isolation level in SQL.
We'll go in eight parts, from the single transaction to many transactions running together. How a DBMS actually enforces all this, with locks, timestamps and the log, is the next chapter.