views:

52

answers:

2

So I have done some research and found out that MongoDB doesn't do fsync(), which means that when you tell the database to write something, the database might tell you it's written, although it's not. Isn't this going against CRUD?

If I'm correct, are there any good reasons for this?

+1  A: 

Is this relevant?

durability: added occasinal file sync
default: sync every 60 seconds, confiruable with syncdelay

http://github.com/mongodb/mongo/commit/c44bff08fd95616302a73e92b48b2853c1fd948d

Noah Watkins
+1  A: 
Niels van der Rest
Ok, so the database data has satisfied D in ACID every 60 seconds cause fsync() is executed every minute saving all the data in memory to disk right?
never_had_a_name
@ajsie: Technically not. To satisfy D, the data has to be written to disk **when the database responds successfully**. But MongoDB has written the data only to memory at that point, so the data is not 'durable' yet. It *is* durable after at most 60 seconds, due to the fsync().
Niels van der Rest
@Niels van der Rest: Is MongoDB just violating the D in ACID or are there other violations as well?
never_had_a_name
@ajsie: See my updated answer.
Niels van der Rest
@Niels: But if I have to make a transaction that spans over 2 documents (eg. transferring money) then I guess its not reliable to use MongoDB for that. You say that MongoDB violates all the ACID properties. Do you know which ones CouchDB violates?
never_had_a_name
@ajsie: I'm not very familiar with CouchDB, but I believe it has better ACID support than MongoDB. Probably good material for a new question :)
Niels van der Rest