What is MongoDB's fsync for?

Viewed 7680

I've been using MongoDB for some time, and saw that fsync waits for data to be flushed to disk. Ok, so i thought it was the solution for safety of the data.

It worked well by takes long, longer than SQL alternative. Then I saw that I can put the syncdelay to 0, then speed came back, but I thought how it would be in the future with many many concurrent requests. So I removed fsync option from the updates and inserts and removed the syncdelay configuration option.

To test if the data was being written I quickly checked Rockmongo after I made an update and the data was actually there, super fast!

So really, what is fsync for if it makes the writes slow and without it the writes happen, and fast anyway?

3 Answers
Related