The primary duty of every database administrator is to ensure the availability and durability of an organization’s databases. Database backups have for a long time represented one of the most fundamental ways of achieving this, and are still actively used today. The same is true for database backups in the cloud.
Database backups are crucial for reversing database changes made to production environments, and give you access to the database as it existed at a previous point in time. Snapshots are one solution for this, however, these snapshot backups need to be created when the database is in a quiesced state, or else data will be lost and the backup possibly corrupted.
In this article, we will discuss the challenges normally associated with backing up large cloud-based databases, and look at an alternative approach to database backups using Cloud Volumes ONTAP and NetApp SnapCenter®.
Consistent Backups for Database Management Systems
Why Data Backup Is Important
The advantages of data backups come from offering protection against data issues that occur in production database environments such as undoing changes that have been made inadvertently, rolling back software releases that involved database changes, recovering from hardware failures and other security threats. They can also be used to create software test environments and DevOps CI/CD pipelines.
There are a number of different database backup types, however, most database backups are performed essentially by taking an entire copy of the data and writing it out to file. This is known as a full backup, and the time and storage space required to complete one will be proportional to the size of the source database.
Transaction log backups alternatively provide the ability to incrementally back up all individual transactions performed against a database. This is essential for performing point-in-time restores. In this case too, the baseline needs to be created with a full copy. In the cloud, for example, Amazon EBS snapshots require a full copy of the source data for the initial baseline to Amazon S3.
When creating a storage-level snapshot backup, it is extremely important to ensure that a boundary is created between database I/O operations and the backup itself. This is required to prevent incomplete database data from being captured by the snapshot, which would result in a corrupted backup.
Database systems are continually processing new transactions and writing data out to disk. To ensure that a snapshot backup is only performed when the data on disk is in a consistent state, database activity must be quiesced for a very short time while the snapshot is being taken. This gives the database server the opportunity to complete any pending I/O operations that would otherwise not be captured, and which could therefore lead to the snapshot containing corrupted data. Performing application-aware snapshots, i.e. where the host application collaborates in the snapshot process, prevents this type of data corruption from occurring.
NetApp achieves application-consistent backups by using SnapCenter® to arbitrate the backup operation, temporarily pausing database write operations while Cloud Volumes ONTAP creates the snapshot. After completing the snapshot, normal database activity is resumed.
NetApp SnapCenter: Snapshots, Backups and More
NetApp snapshots provide an ideal solution for database backups and NetApp SnapCenter allows those snapshots to be created in a consistent state for the data stored in ONTAP storage environments. Databases in AWS and Azure require snapshot database backups in order to provide data protection and point in time recovery. SnapCenter allows you to use your existing database tools to manage your databases, while providing a fully-featured and integrated solution for consistent backup, restore and cloning.
Using SnapCenter, you can perform an on-demand backup or schedule backups to run when you need them.
Creating a backup in SnapCenter.
You can also set backup retention settings, which allow for the automatic removal of old backups when they have aged passed a threshold period of time. For example, you can set the threshold period to keep backups for the previous 7 days or 2 weeks, or whatever the requirement is.
SnapCenter retention settings.
In SnapCenter, users create a policy which defines how the backup will be performed, which includes the type of backups that needs to be performed (e.g. Full or Transaction Log, or both), and the schedule that the automatic backups will follow. Creating on-demand backups is also an option, allowing the user to choose a database to backup and the policy to use.
Defining a backup policy in SnapCenter.
Each application to be used with NetApp SnapCenter requires a plugin, as the interface used for integrating with it will be different in every case. NetApp SnapCenter provides built-in plugins for many types of database systems, including Oracle, Microsoft SQL Server, and SAP HANA. Users can also develop their own plugins to extend SnapCenter support to other applications, adding to the growing library of plugins created and shared by the NetApp users community.
As well as database systems, NetApp SnapCenter can be used to create consistent snapshots for Microsoft Exchange, Windows file systems, and VMWare virtual machines and data stores.
After performing a consistent snapshot backup, NetApp SnapCenter can be configured to perform secondary operations, such as triggering NetApp SnapMirror® data replication updates. This allows you to automatically achieve off-site redundancy for your database backups with minimal administrative overhead.
Managing SQL database copies in SnapCenter.
Recovery and Restoration
Databases can be restored back to the original host and database, to the original host into a separate database, or to a different host entirely. During a restore, the SnapCenter web UI allows you to control the placement of the restored database files. You can also choose to apply transaction log backups to do a point in time recovery, as well as customize the process by applying custom scripts to be run before and/or after the restore.
Restoring a backup in SnapCenter.
Software developers can also use clones to create up-to-date test copies of production data. In a similar way to snapshots, NetApp FlexClone® volumes are writable, very space efficient, and initially do not consume any storage space. It is only when data changes are made that additional storage space is required, which is typically minimal in software testing environments. This adds genuine extra value to having regular and up-to-date snapshot backups.
A cloning operation in SnapCenter.
After creation, backups can be managed through the SnapCenter dashboard. One thing you can do here is clone a database from an existing backup. Once you create the clone, you will see a new physical disk attached to the database host machine via SnapCenter; this is how the clone database accesses the source data. As with recovery and restore operations, you can apply database log backups for clones and customize the cloning process with scripts.
After clicking clone, the SnapCenter activity panel shows the progress of the cloning operation, which usually completes in under 20 seconds, no matter how large or small the database is. When the clone has been completed, a new, writable database will be automatically visible in the destination database server; tables can even be deleted in the clone without affecting the production database.
Backups are vital for ensuring that data is protected against all types of issues that can jeopardize production databases. Performing a full dump to file of large databases can be a wasteful process, both in terms of the time taken and the storage space required. Using snapshots backups is an excellent alternative, however, it is imperative to use application-aware snapshots to prevent data corruption in the resulting backups.
Cloud Volumes ONTAP uses a highly-sophisticated implementation of snapshots, which ensures that every snapshot operation is completed in constant time and with maximum storage space efficiency. This makes it fast, easy, and cost effective to perform database backup and restore. NetApp SnapCenter works with Cloud Volumes ONTAP and the host database system to guarantee that every snapshot backup is fully consistent.
Even with redundancy typical in the cloud for storage and high availability, additional protection is required for events such as user error, ransomware attacks, and natural disasters. Using Cloud Volumes ONTAP as your cloud-based solution provides this protection, plus the additional benefits of simplifying database backup and restore alongside SnapCenter.
To get a closer look at SnapCenter in action, watch this webinar.