PostgreSQL/WAL
< PostgreSQLWAL files are files, where changed data values are stored in a binary format. This is additional information and in this respect it is redundant to the information in the database files. WAL files are a specific kind of 'diff' files.
Writing to WAL files is very fast as they are written always sequentially. In contrast to WAL files database files are organized in special structures like trees, which possibly must be reorganized during write operations or which points to blocks at far positions. Thus writes to database files are much slower.
When a client requests a write operation like UPDATE, the modifications to the data is not instantly written to database files. For the mentioned performance reasons this is done in a special sequence and - in some parts - asynchroniously to the client requests. First, data is written and flushed to WAL files. Second, it is stored in shared buffers in RAM. And in the end it is written from shared buffers to database files. The client must not wait, until the end of all operations. After the first two very fast actions, he is informed that his request is completed. The third operation is performed asynchroniously at an later (or prior) point in time.