Newsletters older than 6 months may have links that are out of date. Please use the Search to check for updated links.
How can I ensure that when data is written, it is also really written to disk.
When MySQL writes data, it gives it to the operating system. It is a feature of some operating systems that they use "lazy writes." That is, they do not actually write the data immediately, but buffer it in memory for a short while. This allows the operating system to optimize disk I/O in general. However, it also means that data written by MySQL may not actually be written to disk immediately.
On Windows, MySQL has a --flush-time option that creates a separate thread. This thread flushes unwritten data to disk at the interval given as the value of the option. A value of 0 means that no separate thread is created to take care of flushing unwritten data.
So if you want to ensure that data is really written from memory to disk, you need to check how your operating system handles data writes. InnoDB handles flushing by itself. You can control that with the innodb_flush_log_at_trx_commit values.