Backup systems

Data are crucial for organizations, and they can’t risk losing them due to an eventual storage system failure. So much so, that additionally to data redundancy systems, companies implement backup systems, which make temporary copies of the data on additional media. That way, in the event of a serious failure of the business systems, backup data would be available for recovering business activity, without significant loss of information and without damaging the business.

The most common support used by these systems is magnetic tapes, which provide a sequential access mode to data. They are therefore less versatile than hard drives that provide a random access mode, but the cost of storage is lower.

Backup systems make a temporary copy of the data, at a specific moment. That is, it is a photo of the data we have in an instant, so frozen in time. If those data are subsequently modified, there is no copy of the modifications. This will have to be taken into account when defining backup policies and the periodicity with which backup copies are made. For example, if we perform a full backup every Monday, and we have a system failure on a Friday, when recovering the data we would go back to the data we had on Monday, we would have lost all the modifications made from Tuesday to Friday. In any case, losing the updates of some data, the work of some days, is assumable in front of losing all the information and having to stop the business.

Another feature of backup systems is that access to data is blocked during the copy process. It is intended that while the information is being copied it is not modified. Therefore, companies perform these processes late at night, when no employees are working, in a period of time called the back-up window, in which the different business applications do not have access to the data.

When it is impracticable to define a backup window in which the data cannot be accessed, because, for example, it is necessary to provide an uninterrupted service, the so-called “hot” backups are implemented. In reality, it is about making a copy to an intermediate disk, from which the tape backup will be made later without time restrictions.

In the case of data of very high criticality, in which the loss of any data cannot be admitted, because it is not possible to recover the business activity from the last backup. We have the possibility of making a synchronous replica between the two data architectures, the one we could call production with which our applications are working and the backup one that will normally be in a remote location. In reality, what we would be doing is copying the data in the two sites at the same time, as they are modified, using a mirroring structure.

If we implemented a mirror structure. If there were a local data failure, the remote centre would have exactly all the data, except those that were handling the applications, which would be in the caches and had not yet been dumped to disk. That is, we would lose the unsaved data from the open sessions.

Storage media

The storage media used for backups is magnetic tapes. These provide sequential access, data are accessed from beginning to end, one data after another, and it is not possible to go to a specific area for recovering the data. On the contrary, hard drives allow it, presenting random access.

So why use tapes as storage media? Because tapes provide a large storage capacity at a lower cost than hard drives and sequential access is ok for backup systems needs.

There are tape drives that can be connected directly to a computer and used as an external storage media, that is as if it were a hard disk. But these types of systems are in disuse and today, magnetic tapes are used almost exclusively for backup. In addition, the process of copying the data is a process of sequential nature, we go through all the files one after another, making a copy of the modifications from the previous backup process.

In the environment described, the dominant tape technology is the Cartridge system known as LTO (Linear Tape Open).

Backup tape
Backup tape

Today, the tape drives of large backup centres are operated by robots. In reality, they consist of a mechanical arm that manipulates the tapes, selects them, inserts or extracts them, from the different tape units.

The archive bit

Before beginning to explain how backups work in practice, we must introduce the concept of the archive bit. This is a bit of information associated with a file, which indicates whether a file has been modified from the last backup or not.

How is this bit used for backups? When a file is modified its archive bit is set, and when the file is backed up, its archive bit is clear. It can be said that in the first case the archive bit is activated and in the second it is deactivated, in any case, this way it is known if the file has been modified since the last backup. If it had not been modified, it means that we already have a copy of that file in the backup.

This concept is essential to understand the different types of backups that exist and to be able to plan data backup strategies.

Backup types

We can fundamentally distinguish three types of backups:

Total Backup: All files are copied, it is a complete backup. For all copied files, the archive bit is clear. This type of copy is used as a basis backup for later making other lighter backups with the modified files. Logically, if we have to recover the data, we would first restore the Total backup, and then the backups with the files that had been modified.

Incremental Backup: We copy the files that have been modified since the last backup and clear the archive bit.

Differential Backup: As in the Incremental, we copy the files that have been modified, that is, those that have the archive bit set. However, we do not clear the archive bit.

It is worth asking about when to use the Differential backup, considering having already the Incremental. The answer is clear when the data recovery process is analyzed if we had a disaster and had to recover from the backups. In the case of performing Incremental backups, we first have to restore the Total copy and then all the Incremental copies. In addition, we will have to do it in its correct order, starting with the oldest. Conversely, if we were performing a Differential backup, we would restore the total copy and then the Differential, which makes a more simple and direct process.

With the Differential copy, we handle only an incremental copy, since, by not clearing the archive bit when making the copy, we will always copy what has been modified concerning the Total copy. The drawback is that this Differential copy will be getting bigger and longer to make, there will come a time when it will be necessary to make a new normal copy.

Backup policies

As I said before, if we are handling very critical data and we cannot lose a single byte, we will use mirrored structures. That is, we will have a backup policy in which we will copy everything in duplicate. But of course, this is very expensive and, if we are handling a large amount of data, it may even be impossible in practice.

So let’s assume that we can’t copy everything at all times. We then have to define when we are going to make our backups and how they are going to be. But to define these policies, we have to know which are files modified since the last copy, and this information is provided by the archive bit.

By combining the different types of backups, we define the copy policy that best suits the amount and variability of the data. Here I leave you an example with two possible backup strategies (with weekly periodicity).

Backup policies
Backup policies

The files that have been modified each day are indicated in the first row. On the first day, we started making a total backup, a copy that we would make every Monday. In the next row, I show the copies that would have to be made in the case of using an incremental copy strategy. Note that we need 6 tapes. And in another row, it shows the Differential copy strategy, in which we reuse the same tape every day, we only need one tape.

This example serves to show the difference between the use of incremental and differential copies, but we are not taking into account the amount of data we are handling. To understand it better, I leave you the following exercise.

Backup exercise

We are in charge of making the backup copies in a company and we have to calculate the tapes that we will need to carry out the weekly backup copies, to be able to indicate to the purchasing department how many tapes they have to buy for us.

To do this, we have the following information:

  1. The files that we want to back up are the following with their respective sizes in MB
File sizes
Files sizes
  1. The estimation of the files that will be modified throughout the week:
Modified files
Modified files
  1. The backup policy we are going to follow is a full copy at the beginning of the week and a daily differential copy. This policy is imposed on us by the variability of the data.
  2. The capacity of a backup tape is 30 MBytes

QUESTION: With this data, how many tapes do we have to ask the purchasing department to buy for being able to make the one-week backups?

SOLUTION: To solve the problem, we take the data to Excel where we can easily handle the numbers. The result is:

Result of backup exercise
Result of backup exercise

Where it can be seen that we would have to order 5 tapes from the purchasing department, 3 for the total copy of every Monday, and 2 more for the differential copies of the week.

NOTE:

This post is part of the collection “Data Access and Storage Systems”. You can see the index of this collection here