S3 Introduction

“Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers of all sizes and industries can use it to store and protect any amount of data for a range of use cases, such as websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics.”

So you build you incredible new social network that’s going to take over the world. It has some amazing features that no other social network provides. However, there is one critical feature that you need to add, a provision to upload profile pictures. But here’s the problem, the storage on your EC2 instance is limited. It can’t store millions of user’s photos in there. Also, if you terminate the server that data is *poof* gone! You also can’t horizontally scale your application since the new servers won’t have the data stored on the primary EC2 instance.

The solution to all of your problems is S3. S3 is a service that allows you to store objects (files) that can be fetched later on. You can also store your backups on S3 and use them later. And don’t worry about losing your data either,

“Amazon S3 is designed for 99.999999999% (11 9’s) of durability”

Files are stored under buckets and your bucket names are unique throughout the world. You can’t use the same bucket name even in 2 different AWS accounts.

There are a few storage classes provided. You can decide which one is appropriate for your use case, and hence save costs on storing objects that are less frequently accessed. The classes are as follows:

  1. S3 Standard
  2. S3 Intelligent Tiering
  3. S3 Standard-Infrequent Access (S3 Standard-IA)
  4. S3 One Zone-Infrequent Access (S3 One Zone-IA)
  5. S3 Glacier (S3 Glacier)
  6. S3 Glacier Deep Archive (S3 Glacier Deep Archive)

Let’s take a look at the different classes

S3 Standard

This service provides low latency and high throughput, making it the obvious choice for frequently accessed data. Think about data that is currently used in you application. E.g. profile pictures of users.

S3 Intelligent Tiering

Now, if you’re uncertain of a way of classifying your data to put it into appropriate classes, AWS can do it for you. The S3 Intelligent Tiering makes sure it puts it in the appropriate class based on its access requirements to optimize costs. If an object is less frequently accessed, it will automatically put it in a less frequently accessed storage tier, else in standard.

S3 Standard-Infrequent Access (Standard-IA)

This class provides storage for data that is less frequently accessed but requires rapid access when requested for. It provides high durability, high throughput and low latency. You will be charged to access this data, so you can’t trick AWS. 😏

S3 One-Zone Infrequent Access

Imagine you have data that isn’t frequently accessed, and doesn’t require to be backed up in multiple zones. The other services will store your files on minimum of 3 Availability Zones, while One-Zone, as you may have guessed by now, stores it in a single zone. Hence, you get 20% off of your purchase! Order Now! Heh..😶

S3 Glacier

S3 Glacier is useful for data archiving. You know, storing files that you MAY require some time later. The point of Glacier is to give you cheap storage for files that can be fetched in minutes to hours (3 options). This isn’t useful for data that when requested, loads instantly. You can also configure it to automatically move your objects around between active and archive storages.

S3 Glacier Deep Archive

This is the lowest you can go, in terms of cost. This is obviously for data that is accessed very very infrequently, like once a year or 2 years, maybe 5. You could imagine this is data that was collected years ago, and is deep within your application. Nobody really goes back there, but since it is possibly important or even critical data, you have it stored on S3. Data stored in this service will take a few hours to fetch.

Let’s Talk About The Money 💰

Charges are applicable for the following:

  1. Storage Used (per GB)
  2. Number of Requests (per 1000)
  3. Data Transfer (per GB)
  4. Management & Replication

There are separate charges for different levels of uses. As your usage increases, your cost per GB will reduce. To view and analyse your use case, head over to the pricing section of AWS.

The free tier includes 5GB of Amazon S3 storage in the S3 Standard storage class; 20,000 GET Requests; 2,000 PUT, COPY, POST, or LIST Requests; and 15GB of Data Transfer Out each month for one year.