3 ms·
IMO this is backwards advice. Traditional relational databases with ACID go to great lengths to create the illusion that there's a single, global state, and tha
by lmm 4y ago
IMO this is backwards advice. Traditional relational databases with ACID go to great lengths to create the illusion that there's a single, global state, and that's what leads to people doing things like check-and-set that seem to work. You're far better off using a non-ACID database, simply because incorrect approaches will fail more visibly and more often. Ultimately you do the same amount of work either way, but using a non-ACID database forces you to do it upfront rather than letting you silently mostly succeed with a fundamentally broken data model.
- BoorishBears 4y agoThis is a really optimistic take... Realistically your DB of choice will probably try and tackle ACID half-heartedly because it's what devs expect, and that will lull you into the same false sense of security. Many "eventually consistent" DBs will still have some concept that uses the word "transaction" that works like one until it doesn't (see DynamoDB and multi-region gotchas)
- miohtama 4y agoYour comment is not true for high quality databases like PostgrSQL. Check-and-set just works on the correct isolation level. There is no isolation, your transaction will fail and be rolled back. If you are new to the subject there are extensive reports available from Jepsten, one of the leading names in distributed system and ACID anomaly testing and research. https://jepsen.io/ https://jepsen.io/
- lmm 4y ago> Check-and-set just works on the correct isolation level. Which is not the default one. > There is no isolation, your transaction will fail and be rolled back. How so? Isn't it more likely you'll silently corrupt your data? Even if it does fail noisily, this is a condition you're unlikely to hit in testing, so you'll probably be dealing with it in production.