Live data from Hacker News

When is "ACID" ACID? Rarely

bailis.org

31–34 of 34 posts

Re: When is "ACID" ACID? Rarely

#31
post #12

Earlier quoted context omitted.

Unlike "C" and "A" in "CAP," "AC&D" (specifically, "C") can't be easily separated from "I". Serializability ("I") ensures that database consistency, or maintenance of integrity constraints ("C"), is not violated. While it's possible to get consistency ("C") without serializability (which would give up traditional "I" in favor of a weaker form of isolation), it's often difficult [see http://www.bailis.org/blog/when-is…

Things like MongoDB fail at A and D, which is what the parent was probably thinking of.

It also fails at C for concurrent writes

Re: When is "ACID" ACID? Rarely

#32
post #6

Earlier quoted context omitted.

Did you read the post? First, it covers both default isolation and maximum available. Second, note that many databases (like Oracle 11g) don't actually give you serializable semantics at ANY setting. Third, most of these products are not distributed systems. Fourth, ACID is not a spectrum for distributed systems; it is basically impossible to apply without sacrificing availability. But that's perhaps not a big deal i…

I did read the post. It does cover both default and maximum. I didn't dispute that. I called out the notion that anyone ought to be depending on the defaults in the first place, or that SERIALIZABLE as a default was a good choice. Yes, many don't support SERIALIZABLE. Didn't contradict that either. As to whether many of these are or aren't distributed systems: Ingres - has replication. Aerospike - distributed/fault t…

I would amend that MemSQL is replicated as well as shared-nothing clustered

Re: When is "ACID" ACID? Rarely

#33
post #27

Earlier quoted context omitted.

Sorry, I'm not following. If you have 2 rows storing how much money you have in 1 account then your data isn't normalized and serializability isn't going to solve your problem, if you could be (even) more explicit, I might be able to answer.

The idea is that each account has a balance. Say I have a checking and savings account: there's one row for each and the bank will kindly let either of them get a negative balance provided the sum of both balances is positive. You may not care for this schema design, but I think most people would be surprised that Oracle silently corrupts data and violates constraints here.

I'm not sure that people who use relational databases would be surprised that there can be data-level race conditions. For example, if you write code like: 1) User requests transfer in the UI 2) Query the DB to see if the transfer is legal 3) If so, update the database.

you have to think about race conditions even if the database implements serializability. First of all, you have to have enough of a clue to do steps 2 and 3 inside the same database transaction, or else the isolation level doesn't help you in the least. Everyone who deals with an RDBMS has to worry about transaction boundaries all the time anyway to avoid race conditions, so it's not too much of a leap to assume that people who are used to worrying about transaction boundaries will have to have some idea of what kind of problems those transaction boundaries will prevent for them. Most databases in production systems don't do full-on serializability as an isolation level (and if they do, it's too expensive to turn on), so pretty much every engineer's real-world experience is that if they do a query against table A, then an update against table B based on that data, that they can have a race condition and they need to lock A or materialize potential conflicts.

I guess it's possible that my personal experience or the engineers that I work with are not a representative sample, but if you're working with sensitive issues like money transfers you tend to be really, really super-paranoid about it, and there's no way that something like that is overlooked by a halfway competent team.

Post reply on HN