And once you've solved that problem you don't need or want ACID transactions because they don't actually do anything for you. Order confirmation emails have the same problem as the browser: you can't (or at least shouldn't) actually hold a database-level transaction open while you connect to an email server, so you have to do something like recording a queue of email confirmations that are ready to be sent - exactly the same thing you do when using Kafka.
> issue an attempt to buy it, wait for that attempt to be confirmed/denied, and handle both cases.
Only one user should receive a success. The article describes a setup where both users receive a success because of write skew. This is the very problem that transactions avoid: locking the row storing the number of items in stock so that it cannot be decremented below zero.
You can still use Kafka. What the article is saying is that you can't just check the DB to see if items are in stock and write your order to a queue. Because there might already be an order for the same item in the queue which makes your new order invalid.
Literally the whole point of ACID databases is that multiple clients can operate on the same set of data and avoid putting it into a bad state. If I'm a bank storing an account balance of $20 and you withdraw $20 and I withdraw $20, only one of us should get $20. This is the same problem.
It describes a setup where neither user bothers to check whether they had a success because the authors are affecting not to understand how to use Kafka.
> What the article is saying is that you can't just check the DB to see if items are in stock and write your order to a queue.
You can't do that with a database either. You have to actually handle the case where it fails. It's not actually any easier than doing it properly with Kafka.
> Literally the whole point of ACID databases is that multiple clients can operate on the same set of data and avoid putting it into a bad state. If I'm a bank storing an account balance of $20 and you withdraw $20 and I withdraw $20, only one of us should get $20.
Banks don't actually use ACID transactions for that, because they don't work in the real world; the bank needs to have a record of both your attempts to withdraw $20, not for one of you to see an error. What a bank ends up implementing is much the same as what you implement when using Kafka.
This is provably false, as evidenced by Postgres's FOR UPDATE locking support. Of course you have to handle the failure, that's what tells you your mutation failed. RDBMS systems can absolutely guarantee that writes are performed atomically. One only needs to look at Aphyr's extensive testing of databases with Jepsen. Claiming this is all bunk is dismissing reality.
> Banks don't actually use ACID transactions for that
That's a big ol [citation needed] from me.