Get the App
SLTechnology News&Howtos  ›  Database  › 

Undolog redolog binlog

Shulou Source: shulou.com Published: 2022-06-01 18:27:39 10月04日 Update

The difference between redo and binlog:

1, the first two are to record the changes of the data, the difference is that binlog records the change information of all data, while the redo log of innodb only records the changes of all innodb table data.

2. Binlog is to record the dml and ddl sql statements that have been submitted, while innodb redo log is the dml and ddl statements that are being executed.

3. Binlog can be used as recovery data. Redo log can be used as data recovery after abnormal downmachine or media failure.

4. Under the db file directory, it also belongs to the impassable log files.

Undo log simplifies the process of implementing atomic and persistent transactions

Suppose there are two data An and B, and the values are 1 and 2 respectively.

a. The business begins.

b. Record Agg1 to undolog.

c. Modify Atom 3.

d. Record bread2 to undolog.

e. Modify Bamboo 4.

f. Write undolog to disk.

g. Write the data to disk.

h. Transaction commit

Undo+Redo

The simplified process of a transaction

Suppose there are two data An and B, and the values are 1 and 2 respectively.

a. The business begins.

b. Record Agg1 to undolog.

c. Modify Atom 3.

d. Record Aban 3 to redolog.

e. Record bread2 to undolog.

f. Modify Bamboo 4.

g. Record bread4 to redolog.

h. Write redolog to disk.

i. Transaction commit

Undo+Redo

Characteristics of the transaction

a. To ensure persistence, the RedoLog must be persisted before the transaction commits.

b. Data does not need to be written to disk before the transaction is committed, but is cached in memory.

C.RedoLog guarantees the persistence of transactions.

D.UndoLog guarantees the atomicity of the transaction.

e. There is an implicit feature that data must be written to persistent memory later than redolog

Tags: Transaction data disk guarantee two atom persistence file feature statement procedure A. not for different media information memory just failure data recovery Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL Shulou Technology Redmi macOS