Let's say we have some binary file (.log), and sequence of write operations, for example log1, log2, log3 and each has some block size n (raw data).
question: can I be sure that log1,log2 and log3 sequences can be written in the correct order in ONE file, even if i have few cache levels (disk hardware and OS level)?
update very interested in what will be with records order (not with records) if we have software or hardware failure (reboot or another reason).
update there can be some percent of write failures, but main question is: will write order stay correct?
It depends on the file system. If you are doing something with a transactional file system (e.g. Transactional NTFS) then you get certain guarantees. If you aren't using a transactional file system, then you get far less guarantees about what happens in hardware failure situations.