Amazon S3 and Amazon Glacier Together: the Best of Both Worlds for Your Backup Strategy

(Update) If you’re interested in learning about the differences between Amazon S3 and Glacier, we recommend this article on Amazon S3 vs Amazon Glacier: A Simple Backup Strategy in the Cloud.


When it comes to backing up your data, you just want the safest, fastest, easiest and cheapest solution available, don’t you? Unfortunately, a compromise must be made among those 4 desiderata, especially with regard to the price, which is likely to be much higher when safety, speed, and ease grows too. Two solutions in the Amazon Web Services set are especially interesting to you to consider as a viable backup solution: Amazon S3 and Amazon Glacier. They are two different players with different skills, and your backup strategy should take advantage of both to balance the pros and cons of each of them. Let’s see what those services are used for and how we can make them an excellent solution for your needs.

Amazon S3: the Simple Storage Service

Amazon Simple Storage Service is the most popular and used cloud file storage service offered by Amazon. It is available through interfaces like REST, SOAP and BitTorrent, and data can be retrieved and stored any time and from everywhere. Availability of data is one of the key differences between S3 and Glacier. Being a basic storage service based on a key-value approach, it is very versatile and used for many different purposes. Its most common usage is probably contents storage and distribution. You can distribute your content directly from Amazon S3 or integrate it with other solutions like Amazon CloudFront. Since you don’t pay for data sent from S3 to EC2 it’s great to store data for computation and other analytics. Taking advantage of his elastic scalability and pay-as-you-go pricing, it is great to host static content for websites as well. And, of course, it’s a great solution for backing up and archiving data.

Amazon Glacier: freeze and forget your data

Amazon Glacier is a dedicated solution for data backup which leverages aggressive pricing and durability of data trading off speed and availability time for your data. In fact, Amazon Glacier is optimized for data that is infrequently accessed and for which retrieval times of several hours are suitable. Amazon hasn’t revealed many insights about how Glacier works under the hood. Despite the data retrieval time, in the order of several hours, is similar to the delays of tape-based systems, the general consensus (mostly based on rumors) is that Glacier is not tape-based, rather it runs on high-capacity low-cost hard disks, possibly low-RPM hard drives used in custom racks with proprietary logic. Details you probably don’t care about that much if you consider the incredible price of 0.01$ per GB per month and declared durability of 99.999999999%, which makes Glacier a great solution for (very-) long term data archiving and backup.

The best of both worlds

So, it’s clear that S3 and Glacier are two very different worlds. Speed and immediate availability on a side, ridiculous price and rock-solid archiving on the other. Chances are you will like all those features for a high-efficiency backup strategy, so why not taking advantage of both the services? Amazon makes the process very easy since S3 has a native feature for long term archiving of objects on Glacier.
First of all, you need to set up a lifecycle rule in the AWS Management Console to tell S3 which objects are to be archived to Glacier and under what conditions. In this rule, you specify which objects in the bucket are subject to the policy, a timing for transitioning objects to Glacier and an object age at which the object will be deleted from S3. Every day, S3 will evaluate the policies and act accordingly. If an object is successfully archived to Glacier, the object’s data will be removed from S3 but its index entry will remain as is, and its storage class will be set to GLACIER.

Now, if you need to see what S3 objects are stored using Glacier, you can get it using S3’s LIST API, just like you are already used to do. What is slightly different is the process to retrieve an object. You can’t just GET it, you must RESTORE it from Glacier, wait for the usual 3-5 hours for the object to be unfrozen, then the object will stay available to you for a retention period you defined during the RESTORE operation itself. Once this period is over, the object will be removed from S3 but will remain in Glacier indefinitely. If you are wondering if you can retrieve objects using Glacier’s API, the answer is: you can’t, since they have been stored there via S3 and the mapping between you user-defined object name and the Glacier system-defined identifier is managed by S3 itself.

Cloud Academy