Even if you’ve been using AWS for just a few months you’ll be familiar with EC2 EBS and the option to right click on your volume entry and take a snapshot to back up your data. AWS automatically stores your data on S3. Also, in case you didn’t read the AWS documentation, EBS snapshots are incremental, which means only the blocks that have changed are saved.
In this article, we’ll share with you everything, yes, everything you need to know about the last point-in-time snapshot you’ve taken. We include how it works, how much it costs and the considerations you need to make when automating your database backup using snapshots.
How Do EBS Snapshots work?
One of the most interesting aspects to AWS is how the Amazon cloud magic works, such as how many physical hosts it has (according to Amazon’s previous formal update, a single AWS data center houses 50,000–80,000 servers) and, in particular, how exactly AWS EBS snapshots work.
We don’t know exactly how AWS achieves this. But to get an idea, it helps to understand one of the most common methods of maintaining consistent backups, known as copy-on-write. This supports consistent replication even when a snapshot conflicts with an ongoing write I/O request. In such a case, the write operation is automatically suspended for a short moment while the block to be changed is copied to storage. This will keep a representative point-in-time snapshot. On similar lines, it may also be helpful to understand how restoring snapshots works. In a previous article we covered in detail how we think EBS snapshots do their magic.
EBS Snapshot Pricing – How Much Does It Cost?
The EBS snapshot is one of the key contributing building blocks to the flexibility of AWS. In comparison with costly traditional appliances that only well-established IT organizations could afford, today’s modern IT organization can leverage t cost-efficient EBS snapshots and use the on-demand cloud model to back up only what’s really required. This totally eliminates the need to plan storage capacity required for backup a year ahead, whereby organizations often end up with under or over capacity depending on their anticipated need at the time of purchasing.
In order to estimate your monthly EBS snapshot costs, you need to consider all elements, including the frequency of your EBS updates, the utilized S3 space, the data compression rate (which depends on the data type) and data transfer costs (in the case of a cross-region backup). Let’s take an example of a daily snapshot supporting a data retention policy of 30 days. Next, let’s assume the initial backup was of 2TB and that your incremental daily changes are 5% of the total data on the volume. At the end of a 30-day month the snapshot size will be:
2TB (baseline) + 30(days)*2TB*5%/day = 5TB (without counting compression)
Note: The cost of snapshots varies from $0.0095 to $0.13 per GB-month based on region.
So, in this case, every month you’ll pay 5000*$0.095 = $475 for your EBS snapshots in the cheapest AWS Region. You can also learn how to monitor your EBS in order to control and protect your environment from sudden I/O and throughput peaks.
Automated EBS Snapshots
Even when dealing with a non-critical IT environment, you still want to wake up in morning and find your data safe and sound. To continue development and testing of your applications without interruption or to ensure your customer data remains available you must automate your snapshot schedule. However, there are several considerations to keep in mind before writing the first line command for this purpose.
One of the most important when dealing with backups is consistency. That’s why EBS snapshots are “crash-consistent,” which means each backup captures all data at exactly the same point in time. However, when an EBS snapshot is taken while an instance is up and running, data in memory is discarded which may not work well for sensitive database-intensive applications. So, if we want to make sure a snapshot is application consistent, which means applications start from a consistent state and experience no issues when we recover them, we need to implement application consistent snapshots.
Considering its dynamic manner, your automated backup should keep track of the changes to your environment such as new attached EBS volumes (which can be done using AWS resource tagging). You should also consider your AWS environment growth rate and try to prepare for a sudden peak in line with your specific growth trend. Finally, a data backup is worth nothing if you can’t actually restore the running service. You’re not necessarily protected just because your automated procedures are running. So make sure you monitor your backup procedures and run recovery tests periodically.
Amazon has revolutionized the way organizations consume and build their IT environments, and EBS snapshots are a fundamental feature that changes the way enterprises back up significant parts of their data.
However, despite the maturity of the cloud, there are still gaps that need to be closed such as a higher level of backup granularity, including file-level backup and recovery, and out-of-the-box EBS snapshots across accounts. These are just two of the many reasons we’ve been building Cloud Protection Manager (CPM) over the last five years.