by gnu8 · 13y ago · 0 comments
I'm more than happy to go into significant detail here, but I think it will just get lost in the shuffle of hacker news comments (at some point I should do a proper article on this stuff). Long story short, you simply cannot make things reliable without having a balance change and its corresponding state update happen atomically. There's other parts you would be well advised to do within that same transaction (ledger entries being the most notable) but you could get by doing that separately if you really hate yourself.
What accountants call a transaction is similar to, and probably inspired, what computer scientists call a transaction. But they are not strictly isomorphic.