| ▲ | sksksk an hour ago | |||||||
I get you with needing a ledger, which most banks use. I'm assuming Revolut do as well, but this engineer wasn't aware. Or perhaps it was a different question they thought they were asking, or maybe a misunderstanding. But the two ATMs problem would be solved by securing a lock on the database before proceeding with the transaction? | ||||||||
| ▲ | mrkeen an hour ago | parent | next [-] | |||||||
He suggester that they had both. My question was what to do when they disagree, and he wasn't able to either conceive of the 'two sources of truth problem' or wasn't able to suggest a solution. He pushed back saying: if they disagree then you've got buggy code, and that your job is to not write buggy code. "That's why we test". "For race conditions?" etc. etc. Who owns the database in your locked example? | ||||||||
| ||||||||
| ▲ | ergl an hour ago | parent | prev [-] | |||||||
> But the two ATMs problem would be solved by securing a lock on the database before proceeding with the transaction? You can also let an overdraft occur. Now the user ows the bank some money and you can charge them interest for their debt. | ||||||||