A transaction is a logical unit of work that may include any number of file or database updates.
Transaction consistency occurs only before any transaction starts, following the completion of a successful transaction, before the next transaction begins, and when the persistence layer is closed or stopped. After a failure, the data will not be transaction consistent if transactions were in-flight.
The techniques used to implement transaction consistency generally flush all I/O operations from memory to the persistence layer and stops any subsequent I/O operation, until the snapshot starts.
The same logic can be applied to any file-system or application that works with persisted data. It’s important to note that only the primitives on which these techniques are not built on are generally available. The actual implementation of the technique must be done and maintained.