sync (Unix)

[2] Some Unix systems run a kind of flush or update daemon, which calls the sync function on a regular basis.

PostgreSQL for example may use a variety of different sync calls, including fsync() and fdatasync(),[5] in order for commits to be durable.

[7] Turning off the fsync requirement can therefore greatly improve commit performance, but at the expense of potentially introducing database corruption after a crash.

To avoid any data loss return values of fsync() should be checked because when performing I/O operations that are buffered by the library or the kernel, errors may not be reported at the time of using the write() system call or the fflush() call, since the data may not be written to non-volatile storage but only be written to the memory page cache.

[14] This hardware feature is called Force Unit Access (FUA) and it allows consistency with less overhead than flushing the entire cache as done for ATA (or SATA non-NCQ) disks.