- Mastering MongoDB 3.x
- Alex Giamas
- 83字
- 2021-08-20 10:10:55
fsync
MongoDB normally writes all operations to the disk every 60 seconds. fsync will force data to persist to disk immediately and synchronously.
If we want to take a backup of our databases we need to apply a lock as well. Locking will block all writes and some reads while fsync is operating.
In almost all cases, it's better to use journaling and refer to our techniques for backup and restore in Chapter 7, Monitoring, Backup, and Security, for maximum availability and performance.