April 2019
Beginner to intermediate
244 pages
6h 34m
English
Throughout this book, we’ve been working with one database operation at a time. But there are times when you have multiple operations that need to be treated as a group: they all need to succeed together, or fail together.
A classic example is transferring money between two bank accounts. If we want to transfer $10 from Bob’s account and put it in Alice’s account (it’s always Bob and Alice for some reason), we have to perform two updates: reducing Bob’s balance by 10 and increasing Alice’s balance by 10. But what would happen if the update to Bob’s balance succeeded, but the update to Alice’s balance failed? The accounts would be out of sync, and the $10 would effectively be missing. ...
Read now
Unlock full access