Difference between Synchronous and Asynchronous backup
Difference between Synchronous and Asynchronous backup

CALL NOW FOR FREE CONSULTATION

+91 9983340133, +91 9001997175

grras

Difference between Synchronous and Asynchronous backup

Before knowing the difference, what we need to know is what is back up and why we need to do backup?

A backup is a copy of data from your database that can be used to reconstruct that data in case the original is lost or corrupted. In terms of computer we can say, backup means to copy files to a second medium (can be a disk) as a precaution in case the first medium fails.

In Linux we use the commands such as rsync, tar, etc

rsync — a fast , versatile, remote (and local) file-copying tool.

It is widely used for backups and mirroring and as an improved copy command for everyday use.

Syntax: rsync [option] source destination    //the source and destination can be remote or local but as here we are discussing about local so we will use them as local

Synchronous backup

# rsync –zvr /data1 /backup1               //here we are taking compressed form of backup of data1

Synchronous backup time stamp is preserved, this is achieved by archive mode .So as to use it we write rsync –a where “a” preserves symbolic link , permissions , timestamp ,owner and group.

#rsync –azvr /data1 /backup1

Now, to check the timestamp we will use the command

# ls –l /data1 /backup // in both backup types you will get the difference
/backup1:total 4

drwxr-xr-x. 2 root root 4096 Jul  2 23:04 data1 

/data1:   

total 8

-rw-r–r–. 1 root root  6 Jul  2 22:00 a

-rw-r–r–. 1 root root 13 Jul  2 23:04 b

 

The best feature of rsync is that if any changes occurs in the original file and you want this change to be a part of the backup made then only the change is copied or we can say incremented in the backup made.

Asynchronous backup

This backup is achieved by using the tar command which is used to convert files into archive or tarballs .

Syntax: tar [option] [archivename] [filename]

# tar –cpvf xyz.tar /etc 

 

In case of asynchronous backup we need to know which file has been changed due to which mostly we use synchronous backup .We can also test or view the archive by using options –t , -list etc .By using tar you can compress files in .bz2 or .gz by using option j and z respectively.

 

Difference between Hot backup and Cold backup

 

Hot backup and Cold backup are both used for system backups, these backups are created for any sort of media failure. The lvm snapshot is used in this sector basically.

HOT backup

>> Hot backups are the one which are taken when the database is active.

>> The database must be in archivelog mode.

>> This is used where data is not that important as we can’t use this type of backup in banking

>> You cannot shutdown in normal or immediate mode a hot backup if it is started, if you do so you’ll get an error message that you are in backup mode.

>> tablespaces in this can be backed up on the basis of schedules.

COLD backup

>> It is done when the database is not active i.e. the system is in shutdown mode.

>> Here, we can have complete restoration from the copy.

>> It is a physical backup of the database which is achieved when the system is shutdown normally not aborted or immediately.

>> In this we use the command such as dd, tar, fbackup etc.

>> It provides consistency.

MAJOR DIFFERENCE BETWEEN THEM ARE  :

  1. 1.    To achieve hot backup we need archivelog mode whereas in cold backup we create the backup at the same time.
  2. 2.    In hot backup we can schedule the tablespaces for backup which is not possible in cold backup.
  3. 3.    We need to inform the system when backup starts and completes in case of different tablespaces scheduled for backup in hot backup but not in cold backup.
  4. 4.    Hot backup are used where the system are large and the processing can’t be stopped in any case.
  5. 5.    Cold backup are used where data plays vital role i.e. the processing can be stopped for some duration.

 

Leave a Reply

Your email address will not be published. Required fields are marked *