The main difference between backup and recovery is that backup is a copy of data that can be used in a database failure while recovery is the process of restoring a database to the correct state when a failure occurs.
DBMS (Database Management System) is software that helps to manage databases easily and effectively, allowing users to organize data in an organized manner. DBMS provides multiple advantages. It allows storing, manipulating and retrieving data from databases. It also allows performing transactions and provides protection to data. Backup and recovery are two main concepts related to DBMS.
Key Areas Covered
1. What is Backup
– Definition, Functionality
2. What is Recovery
– Definition, Functionality
3. What is the Relationship Between Backup and Recovery
– Outline of Association
4. What is the Difference Between Backup and Recovery
– Comparison of Key Differences
Backup, Logical Backup, Physical Backup, Recovery
What is Backup
A backup is a representative copy of data. It includes important elements of a database such as control files, data files, etc. There can be unexpected failures in databases. Therefore, it is a better solution to keep a backup of the database. There are two major types of backups. They are the physical backups and logical backups.
Physical backups are copies of physical database files such as data files, control files, archived redo logs and log files. They are copies of files that stores database information to some other location. They are the foundation of the recovery mechanism in the database.
The other backup type is logical database files. These logical backups contain the logical data that are extracted from a database. It consists of views, functions, tables, procedures, etc. However, taking only logical backups is not very beneficial because they only provide structural information. Overall, taking backups is useful as it helps in a database failure.
What is Recovery
Recovery helps to restore a database to the correct state when a failure occurs. In other words, it allows the database to come to a consistent state after a sudden failure. Therefore, the recovery process improves the reliability of the database.
It is possible to recover the database using log-based recovery. A log is a sequence of records that contains records of a transaction. The log of every transaction is maintained in some stable storage. It helps to recover the database during a failure. The log contains the information about the transaction to execute, modified values and the transaction state. All these information will be stored in the order of execution.
Furthermore, it is possible to recover in concurrent transactions. The logs can interleave when two transactions execute simultaneously. It is a difficult process to recover the system and to return all logs to a previous point. A checkpoint is a solution to this issue. The checkpoints work as benchmarks.
This mechanism removes previous logs from the system and stores them permanently in a storage system. It declares a point at which the DBMS was in consistent state. It also involves tasks such as writing log records of main memory in secondary storage and writing checkpoint records in the log file. When a transaction fails, the recovery system adds the checkpoint to the transaction.
Relationship Between Backup and Recovery
- Backups can speed up recovery.
Difference Between Backup and Recovery
Backup is a copy of data that is used to restore the original after a data loss event occurred. Recovery is the process of retrieving inaccessible, lost, corrupted, damaged or formatted data to the original state. These definitions explain the main difference between backup and recovery.
A backup is a replication of data while recovery is a process to store the database.
Backup and recovery are two main concepts related to DBMS. The difference between backup and recovery is that backup is a copy of data that can be used in a database failure while recovery is the process of restoring a database to the correct state when a failure occurs.