Reply to post: Re: They offer, not drop, ACID it seems

MongoDB turns on, tunes in, drops ACID and goes mobile

Adam 1 Silver badge

Re: They offer, not drop, ACID it seems

Of course there is an overhead to ACID compliance. It isn't as if $(EVERYONEELSE) has a bunch of Thread.Sleep() calls hanging about. Atomicity requires that my transaction should either run to completion or be completely undone. That requires keeping track of my uncommitted changes until one of those outcomes. Not free. Consistency requires that constraints are honoured. You cannot merely insert a record, you need to assert the existence of every foreign key target. You cannot merely delete a record without checking for child records that would be orphaned. Isolation is a big cost. You cannot have a free for all with different concurrent users updating the same records. Otherwise you cannot have atomicity. This means (usually) some form of record locking, so now you need to lock and unlock things as you write them. Those locks have to be immediately visible across other threads, so you have to wait for CPU pipelines to flush at all sorts of times. And durability means that the thing cannot run off and cry in a corner with missing committed data, even in the event of a total failure of everything other than the storage. So now you cannot be satisfied that the commit has completed until the disk cache has been flushed. And you need to remember to use the appropriate APIs so the OS doesn't lie to you and return early.

Engineering is about tradeoffs. ACID compliance is about guaranteeing data correctness even at the cost of performance in some situations. Mongo et al have their uses. If my document store can be regenerated in the event of a failure, I may decide to forgo the correctness promises of a real DBMS to get better performance. But I cannot trust someone with my data where their worldview is that most people don't need ACID compliance. There are very few problems where data loss is inconsequential, and a half arsed attempt at ACID compliance is the worst of both worlds. You can very easily picture someone with that attitude not waiting for disk flushes and ending in a lot of bother when the proverbial hits.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019