Wednesday, April 24, 2024

Snapshot vs Backup: Key Differences and Use Cases

Preventing data loss has become a primary concern for all businesses following the continuous rise of ransomware attacks. Unfortunately, malware and viruses are not the only threats to data since accidental modification, intentional deletion, or even a natural disaster can irreversibly damage an organization.

Luckily, modern technologies such as snapshots and backups provide data protection by allowing you to roll back to a previous version of your machine or data in case it was compromised. However, not all technologies are created equal. While both snapshots and backups allow you to recover virtual machines (VMs), they differ in nature and purpose; and they are not interchangeable.

This blog post defines each technology and details the differences between snapshots and backups while also explaining their varying use cases.

What Are Snapshots?

To put it in simple terms, a snapshot is basically the picture of a virtual machine (VM), database, or file system at a specific point in time. The current version of the VM, including all its data such as memory and disks, is preserved without being copied, and you can instantly revert back to it. The power state of the VM is also maintained, whether it was powered on, powered off, or even suspended when the snapshot was taken.

You can create and manage single snapshots or extensive snapshot chains from the VM itself. Keep in mind that new snapshots will overwrite older ones if you run low on storage space.

Different types of snapshots

There are two main types of snapshots:

  • Copy-on-write (CoW): This system copies any block to a separate snapshot area before it is modified and overwritten with new information. Unchanged blocks are not included in the snapshot, which reduces the required storage space. VM performance can be impacted since every request to write new data is preceded by the need to copy out the block.
  • Redirect-on-Write (RoW): Unlike CoW, the original data is not copied. Instead, once you create a snapshot, the system allocates new space for the new information and leaves the existing blocks in their original location. This type consumes less storage space but negatively impacts the performance of a VM since the new data exists on multiple snapshots.

VMware snapshot

In VMware environments, the virtual disk with the raw data is a .vmdk file set to read-only mode when VMware snapshots are created. The new data is then written on a .vmdk delta disk that retains the difference between the state of the VM when the snapshot was taken and its current state.

Two more files are also created when you take a VMware snapshot: a .vmsd file, which is the database for the snapshot itself and which contains all the metadata information in addition to the .vmsn file holding the active state of the VM. The last file is necessary since it allows you to revert back to the running state of the VM, and without it, reversion is turned off.

Once a snapshot is committed, all changes are merged in the .vmdk file that goes back to read-write mode.

For optimal performance, VMware recommends that you use up to three snapshots in a chain but, if need be, you can create a maximum of 32 snapshots. Make sure you do not keep a snapshot for more than 72 hours since it will keep increasing in size and consume your storage space.

Hyper-V checkpoints

For Windows Server 2012 R2 and beyond, Hyper-V snapshots were renamed as Hyper-V checkpoints. Creating a checkpoint will set the virtual disk as read-only, and the running VM is paused. The following files are also added:

  • .avhd(x): this is a differencing disk added to the same folder as the parent virtual disk.
  • .xml: configuration file copy.

You will also find two additional files if the VM is running:

  • .bin: the state of the VM when the checkpoint was created.
  • .vsv: memory information file.

When Should I Use Snapshots?

While snapshots are not a substitute for backups, they do provide short-term data protection. As previously mentioned, snapshots do not make a copy of your data, so rolling back to the previous state of your VM can be done almost instantly.

Organizations tend to rely on snapshots in development environments, but that does not mean that they are entirely useless in production environments. You can use snapshots as a failsafe rollback in the following cases:

  • Performing and testing unsafe software updates on a VM
  • Implementing configuration changes that leave a VM unbootable
  • Developing and validating code changes

What Is a Backup?

Backups create copies of entire systems or individual files. The key difference between snapshots and backups is that the latter copies your data while the former is no more than an image of the VM. Another important distinction is that backups can be stored in a different location than the source and, in this case, they become completely independent. 

Read more about VMware backups here and discover the best practices that ensure data protection and recoverability. 

Different types of backups

There are three major backup types:

  • Full backup: as the name suggests, full backups copy all the data you want to protect. In this case, the backup and recovery processes can be time-consuming.
  • Differential backup: this procedure copies the files that have changed since the last full backup. This means they consume a lot of storage space due to the ever-growing number of files. And while they are much quicker, the recovery process is more complex since you will need to restore the full backup first and then every incremental backup.
  • Incremental backup: using this technique, you only back up the changes since the last backup. Incremental backups are fast and do not require much space.

When Should I Use Backups?

Easy! Use backups whenever you need to store a copy of your data for an extended period of time. Backups are the ideal data protection technique since they provide a variety of recovery options. Moreover, you can eliminate a single point of failure with multiple backup targets.

The best way to do that is the 3-2-1 rule: have at least three (3) copies of your data, store two (2) backup copies on different storage media, with one (1) located offsite in a backup repository, a public cloud, or offline storage.

Backup From Storage Snapshot

Instead of focusing on the differences between snapshots and backups, it is important to learn how to leverage the capabilities of both technologies to maximize data protection. Storage snapshots can be used as part of the backup operation since they help you reduce the load on the production environment.

In other words, you can use a backup from storage snapshots to create agentless, incremental, and image-based backups of VMware vSphere VMs without impacting VM performance. This also improves your recovery point objectives (RPOs) since you will be adding more point-in-time copies of your machine.

Snapshot vs Backup

So it all goes down to this; which one is better? The short answer is: it depends on your goals since both procedures have pros and cons. The table below highlights the main differences between snapshots and backups.

Concluding Thoughts

The importance of VM snapshots cannot be understated, especially in development environments. However, if you are looking for a long-term and reliable data protection technique, you should definitely rely on backups. Modern solutions allow you to use VM snapshots as part of the backup process so you can offload your production environment and avoid performance issues.

Share this article

(Ambassador)

This article features branded content from a third party. Opinions in this article do not reflect the opinions and beliefs of New York Weekly.