Hacker News new | ask | show | jobs
by mrkeen 41 days ago
I don't think you can avoid negative balance, without giving up on availability (i.e. moving from AP to CP). And then an outage like TFA takes down your whole system.

You might be assuming that there is only one database, and that all consumers are reliably connected it. So who owns the database: Visa or MasterCard? Because ACID doesn't span across database instances (let alone database vendors or companies).

If you write down that "Bob withdrew $20", that cannot be wrong, (at best it can lack info that you later wish you had).

If you write down "Bob's balance is now $10", you already know the problems with that from your question.

1 comments

Thank you for this! I agree, but I still don't see the difference between a ledger and a relational DB when both write "Bob withdrew $20". Maybe I'm a bit thick.

You're right that I assumed there would only be one database or one ledger.