All or nothingadvanced
A sequence of writes has to either all happen or none of them, because the state in between is one where the money has left one account and not arrived at the other.
An order, an outbox message and a ledger entry, written by two SaveChanges calls with a crash-shaped gap between them. Decide where the unit of work actually ends and make the gap impossible.
AssumesAll Or NothingThe same all-or-nothing problem with no ORM in the way. Worth fifteen minutes before this one.
Either all three rows exist or none of them do, whatever moment the process dies at.
Published in full, before you start — every point is one of these and there is nothing else.
A sequence of writes has to either all happen or none of them, because the state in between is one where the money has left one account and not arrived at the other.
A request that times out has not necessarily failed — you just did not hear back — so the client retries, and unless the write recognises that it has already happened the customer is charged twice.