Thursday, May 19, 2016

Incremental Backup and Differential Backup

Full Backup

Before getting to know incremental and differential backup, it is necessary for us to learn what "full backup" is. Full backup refers to creating a backup of all the valid data, whether it is new added or exists for a long time. For instance, a backup of the operating system refers to back up all the data in system partition. If the system files of Windows 7 occupy 12GB, a full backup of this system partition will contain data of 12GB. Namely when making a full backup of a disk, all the data on the disk will be backed up. So does the full backup of a partition. The object of full backup can be system partition, data partition, a whole disk, etc.
Generally speaking, we will do a system full backup after installing operating system. After a period of time, we will add some data to system partition, and then we would like to do a system backup again. If we employ a full backup, it will cost more time than the last full backup. What's more, the compressed image file of the first full backup might occupy 8GB, and the image file of the second full backup might occupy another 8GB or more. In the two image files, there are many identical data. There is no need to back up these identical data for the second time. Only the new added data need to be backed up. Thus, it can not only reduce the time of backup, but also can reduce the storage space of the seconds image file.
Full backup mainly has two disadvantages. On one hand, it would cost more time. On the other hand, the image file of full backup requires more storage space. There isn't any way to remove the reduplicative data but to delete the image file of the last full backup. Luckily, the appearance of incremental backup makes it possible to figure out all these problems.

Incremental Backup

Incremental backup refers to back up the changed and new added data based on the first full backup or the last backup. Incremental backup will not back up the identical data based on the last backup. Incremental backup is on the basis of the last backup, so that there will be a mutual dependent relationship between them two. That is to say, each backup will create an image file, and all the image files are related together. The last image file of incremental backup is based on the previous image file. The deletion of a previous image file will make all the subsequent image files invalid.
Here is an example of incremental backup. Suppose that D Drive has data as follows:
File nameFile size
D:\file1.txt5GB
D:\file2.txt10GB
First, let's make a full backup of D Drive. And then there will be a 15GB image file: imagefile1.adb, which includes file1.txt and file2.txt. 
Then, let's add 2 files-file3.txt and file4.txt to D Drive. Now D Drive will have the files as follows:
File nameFile size
D:\file1.txt5GB
D:\file2.txt10GB
D:\file3.txt2GB
D:\file4.txt1GB
If we make a full backup of Drive D during the second backup, all the 18GB data on Drive D will be backed up. Meanwhile it will generate an 18GB image file: imagefile2.adb. Now, file1.txt and file2.txt turn to be reduplicative data of the two full backup.
If we make an incremental backup of Drive D for the second time, then only the new added files-file3.txt and file4.txt will be backed up. Compared to the image file backed up before, there is not any change for file1.txt and file2.txt so that they will not be backed up. At last, the second incremental backup will generate an image 3GB file: image-inc.adb, which is based on imagefile1.adb. So if imagefile1.adb is lost, image-inc.adb will become invalid.
If we restore imagefile1.adb to Drive D, the restored D Drive will only consist of file1.txt and file2.txt. If we choose to restore imagefile2.adb or image-inc.adb to Drive D, all of the four files will be recovered.
Since incremental backup just deal with the changed, new added and deleted files, it will cost less time in restoring. Meanwhile, it omits the reduplicative data so that the storage space has been reduced, which makes up for the drawbacks of full backup.

Differential Backup

Similar to incremental backup, differential backup is used to back up the changed data based on the last full backup. That is to say, it is based on full backup, not incremental backup. As for its advantage, it can help to improve backup efficiency and reduce storage disk space required by the image file. It is another form of incremental backup. Here comes an example of differential backup.
Suppose that E Drive has the following data:
File nameFile size
E:\file1.txt2GB
The first full backup of Drive E will back up file1.txt, and then generate an image file: image1.adb.
Then, add file2.txt to Drive E, and then make an incremental backup to generate an image file: image2.adb.
Then, add file3.txt to Drive E, and then make an incremental backup to generate an image file: image3.adb.
Then, add file4.txt to Drive E, and then make an incremental backup to generate an image file: image4.adb.
At this moment, there are four image files all together. Image4.adb is based on image3.adb; image3.adb is based on image2.adb; image2.adb is based on image1.adb. In conclusion, incremental backup is always based on the image file of the last backup.
At this time, if we do a differential backup and generate an image file: image-diff.adb, these three files: file2.txt, file3.txt and file4.txt will be backed up together, excluding file1.txt. Because differential backup is just based on full backup, and the file1.txt has been backed up in the first full backup, so it will not be backed up again. At this time, image-diff.adb is just on the basis of image1.adb, and has no connection with the image files: image2.adb, image3.adb, and image4.adb.
During the operation of restore, if we restore image2.adb to Drive E, the restored Drive E will include only two files: file1.txt and file2.txt, excluding file3.txt or file4.txt. If we restore image4.adb or image-diff.adb to Drive E, all the four files: file1.txt, file2.txt, file3.txt and file4.txt will all be restored back.

No comments:

Post a Comment