Home  >  Article  >  Database  >  What types of data backup can be divided into

What types of data backup can be divided into

青灯夜游
青灯夜游Original
2021-01-04 16:13:1515694browse

Data backup can be divided into: hot backup, cold backup and warm backup. Hot backup can be backed up directly while the database is running, without any impact on running database operations. Cold backup must be performed when the database is stopped, and read and write operations on the database cannot be performed. Warm backup is performed while the database is running. Only read operations are supported during backup, and write operations are not supported.

What types of data backup can be divided into

#The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

Recommended tutorial: mysql video tutorial

Backup is a necessary means just in case, when hardware damage or non-human factors cause data loss , you can use backup to restore data to minimize losses, so backup is a must. Backups can be divided into the following types.

According to the backup method (whether the database needs to be offline), the backup can be divided into:

  • Hot Backup

  • Cold Backup

  • Warm Backup

Hot backup can be backed up directly while the database is running. There is no impact on the running database operations, and the read and write operations of the database can be performed normally. This method is called Online Backup in the official MySQL manual.

Cold backup must be performed when the database is stopped, and read and write operations on the database cannot be performed. This kind of backup is the simplest, and generally only needs to copy the relevant database physical files. This method is called Offline Backup in the official MySQL manual.

Warm backup is also performed while the database is running, but it will have an impact on the current database operation. Only read operations are supported during backup, and write operations are not supported.

According to the content of the backup file, hot backup can be divided into:

  • Logical backup

  • Naked file backup

In the MySQL database, logical backup means that the content of the backed up file is readable, usually text content. The content is generally composed of SQL statements or actual data in the table. Such as mysqldump and SELECT * INTO OUTFILE methods. The advantage of this method is that the contents of the exported file can be observed, and it is generally suitable for database upgrades, migrations, etc. But its disadvantage is that the recovery time is longer.

Bare file backup refers to copying the physical files of the database. It can be copied while the database is running (such as tools such as ibbackup and xtrabackup), or the data files can be copied directly when the database stops running. The recovery time of this type of backup is often much shorter than that of a logical backup.

According to the content of the backup database, backup can be divided into:

  • Full backup

  • Partial backup

Full backup refers to a complete backup of the database, that is, backing up the entire database. If there is a lot of data, it will take up a lot of time and space.

Partial backup refers to backing up part of the database (for example, only backing up one table).

Partial backup is divided into:

  • Incremental backup

  • Differential backup

Incremental backup requires the use of professional backup tools. It refers to backing up changed data based on the last full backup. That is to say, each backup will only back up the data generated between the last backup and the backup time. Therefore, each backup saves space than differential backup, but it is troublesome to restore the data.

Differential backup refers to the data that has changed since the last full backup. Compared with incremental backup, it wastes space, but restoring data is simpler than incremental backup.

When performing different backup methods in MySQL, you must also consider whether the storage engine supports it. For example, MyISAM does not support hot backup, but supports warm backup and cold backup. InnoDB supports hot standby, warm standby and cold standby.

Generally, the data we need to back up is divided into the following categories:

  • Table data

  • Binary log, InnoDB transaction log

  • Code (stored procedure, stored function, trigger, event scheduler)

  • Server configuration file

If you want to read more related articles, please visit PHP Chinese website! !

The above is the detailed content of What types of data backup can be divided into. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn