Operations on the database are recorded on the transaction log. The transactions logs can be used to rollback a transaction, recover a database, or backup (replicate) a database.
Logs are written before the operations occur. Periodically the log files are written ("flushed") to disk. This can be scheduled after a period of time, after so much data is accumulated, or manually with a `FLUSH LOGS` command.
For each operation, the log file includes the transaction ID, a sequence number, the previous sequence number, the object, the type of operation, an image of the row before the operation, an image of the row after the operation, and other metadata.
Transaction logs have a variety of names, including "Binary Logs" or "Bin Logs" in [[MySQL]], "Write Ahead Log" in [[Postgres]], "RedoLogs" in Oracle and "Transaction Logs" in MS SQL Server.
Log files are in binary but can be human readable with a utility provided by the DBMS.