Why doesn't MongoDB use fsync ()?

So, I did some research and found out that MongoDB does not execute fsync (), which means that when you tell the database to write something, the database can tell you that it is written, although it is not. Isn't that against CRUD?

If I am right, are there any good reasons for this?

+3
source share
2 answers

The reason is performance. Without the need to write to disk with every change, MongoDB can process updates faster.

MongoDB , , , getLastError:

: , [] . , , fsync .

ACID, D, :

[], , , , , .

ACID . NoSQL, MongoDB, ACID, . MongoDB .


MongoDB ACID

ACID - . , . MongoDB , . ACID MongoDB.

A — Atomicity , . ; , . MongoDB , .

C — , . , . MongoDB , ACID .

I — , ; , . . MongoDB , 1). .

D — . MongoDB () ACID-ic.

, MongoDB , ACID. , , , , , .

MongoDB . . , . , MongoDB.

1) , db.eval() . , , db.eval().

+11

?

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

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

+2

Source: https://habr.com/ru/post/1765312/


All Articles