Amazon holds a bulk of the cloud services market, thanks at least partially, to its significant number of available services. One of these services, Elastic Block Store (EBS), is particularly popular due to its value as persistent block storage for Elastic Cloud Compute (EC2) instances, virtual servers running on AWS infrastructure. EBS grants users the ability to work with containerized applications, relational and non-relational databases, big data analytics, media workflows and more.
Being able to accomplish all these tasks is only useful, however, if you can ensure that your data won’t be lost. For this reason, AWS includes a backup system in EBS called snapshots. If you’re an EBS adopter, you likely have some experience with these snapshots but you may not realize all of the ways in which they can be used. Here, I’ll discuss a few ways to get more value from your snapshots and hopefully teach you something new.
What Is an EBS Snapshot?
An EBS snapshot is a point-in-time, incremental backup of your EBS volume. They can be used for individual volumes, or across multiple volumes within the same region, allowing you to back up large databases or file systems. Originally, you had to stop running instances and coordinate between volumes for these backups to be crash-consistent but now, AWS will automatically condense information into a single snapshot to ensure that even operations pending at the time of snapshot are accounted for. Snapshots are initiated from the console or Command Line Interface (CLI) and can be monitored through CloudWatch Events.
5 Features of Snapshots
Knowing that snapshots are useful for backing up your information is one thing but knowing how to get the most out of them might not be so obvious. The five features below can help you get added benefit from your snapshots and streamline your workflows.
AWS makes a huge point of saying that snapshots are incremental backups and that this can save you on storage costs but it may not be clear how this works. The first time you create a snapshot, you are backing up an entire volume and all of its data. Each subsequent snapshot then only saves the data that has changed since the previous shot and simply points to the older snapshot or snapshots that contain the unchanged data. This is where the savings come, as you eliminate duplicate data that would otherwise occur with multiple snapshots.
If you delete an old snapshot, the data still required from it is automatically pushed forward to the next subsequent snapshot and existing references are updated. What this means is that you have a lot of flexibility when it comes to managing snapshots, as you can delete backups from anywhere in the chain without affecting the functionality of others.
There are a few different ways to automate snapshots, all of which can save you time and effort while ensuring that your data is safely backed up. Until recently, Lifecycle Manager, a dedicated EBS service, was the simplest way to schedule and manage snapshots. Through the implementation of policies you specified which volumes you wanted to be backed up, how frequently snapshots should be taken, how many should be kept, and what time backup should start. If you are only using EBS, this method is still available and works great.
If you’re using other services in addition to EBS, consider using the newly introduced AWS Backup which has the same functionality but also works with Relational Database Service (RDS), DynamoDB, Elastic File System (EFS), and AWS Storage Gateway. Or, if you want more control and flexibility in your automation you can backup EBS snapshots using the CLI. This method uses custom scripts and Chron jobs, typically run through Amazon Lambda and allows you to more easily store snapshots in different regions, different services, and with different permissions or encryption settings.
Creating fresh volumes
Snapshots primary purpose is to serve as a backup should your volumes fail or become corrupted but they can also be used to create duplicate volumes. To create a new volume from a snapshot, you simply need to know the snapshot ID and have access permissions, and you can control the creation from either the console or the CLI.
Duplicate volumes can be useful for both Redundant Array of Independent Disks (RAID) configurations and as test environments. With RAID, duplicate volumes can either be used to increase throughput, by distributing workload across volumes or for increasing data redundancy by making mirror volumes available.
As test environments, duplicate volumes can be used for AB testing, to test the compatibility of tools or applications before going into production, for penetration testing or incident response training, etc.
While you cannot initiate new volumes in Region X from a snapshot stored in Region Y, you can share your snapshots to other regions and create a volume afterward. This ability allows you to easily expand across geographic regions, set up disaster recovery plans, or even migrate data centers.
Provided you have the correct permission settings, you can even share snapshots to other accounts, which can be useful for collaborative work, third-party integrations, or open-source contributions. When sharing snapshots, you can share both encrypted, if the other user has your Customer Managed Key (CMK) and unencrypted, with anyone.
One downside of sharing is that if you are using a longer resource format, you are only able to share snapshots with accounts that support that format.
Regulatory compliance typically requires certain levels of security for logging of access or modification, long term storage, and the codebase of your application. Snapshots can be perfect for meeting these requirements, particularly if they are kept in Amazon Glacier or another form of archive storage.
Any snapshots you make can be stored indefinitely and restored as needed. If encrypted, they will only be accessible to parties with proper permissions and the encryption key and any access or modification can be logged through AWS or third-party monitoring.
AWS Backup was designed to be PCI and ISO compliant and is HIPAA eligible, so if you are automating your backups, you’re already set.
EBS Snapshots can be incredibly useful once you figure out the tricks to managing them effectively. Even though they may seem at first to only be useful as backups, a little experimentation and creativity can make them much more. The features covered here should help you better understand how snapshots work and help make sure you’re getting the most benefit out of yours by highlighting your possibilities.
If you want to learn more about Amazon EBS features, including EBS snapshots, read this article.