While taking backup our goal is to keep the application, database system, and web site, in running condition while we are taking the backup.
Database backup technique can be classified mainly into two categories:
- Hot Backup
- Cold Backup
Hot backup takes place while the database is operational. Hotbackup is performed without disturbing normal database operations. It captures the changes that takes place while the backup operation is under process. For these reasons, hot backups is more demandable when your database grows up. when the data is large enough and our data is important enough for our business therefore we will have to capture every last change, without putting our application, web site, or web service offline.
Hot Backups are executed at runtime.
Hot backups does not block normal database operations.
Hence Hotbackup are generally used for the enterprice type of applications where latest changes made in the data is very important from the business point of view.
It is also known as online backup as in this case MySQL server is running so that the new data can be obtained from the server.
Hotback maintains the data which includes any data that was inserted or updated while the backup is in progress. It will delete or insert any data that was deleted or inserted while the backup is in progress at realtime.
It consists of two stages:
-In the first statge copying of the InnoDB data files outputs a raw backup.
-In second stage "apply" action incorporates all the changes in the database that took place while the backup is being executed.
On execution, the changes produces a complete backup files and these backup files are ready to be restored whenever necessary.
It's a backup that is taken while the database is shut down.
It is also known as offline backup as in this case MySQL server is stopped.
Important Points to Remember:
For getting maximum back up possible during the hot backup phase, we can assign InnoDB as the default storage engine for new tables, or the InnoDB storage engine for existing tables.
Note: In MySQL 5.5 and higher, InnoDB is the default storage engine.
In hotback the Structure of the database is identified automatically through a database connection.
For a cold backup, we must specify the file locations through configuration files or command-line options.