Database Transactions Explained: ACID and Isolation Levels
Why a bank transfer needs more than two UPDATE statements Move $50 from one account to another and the naive version is two statements: subtract from account A, add to account B. Run them separately, and if the process crashes or the connection drops between the two, the money is gone from A and never arrives in B. The database did exactly what it was told, twice. The business still lost $50. ...