How to get started using Amazon S3
What is S3?
In a nutshell Amazon Simple Storage Server (Amazon S3) is an online storage facility. It is cheap (free for a limited time under AWS’s free usage tier), fast and easy to setup. It used by many large companies including Netflix, Pintrest and is even where Dropbox stores its data. You can therefore rest assured that it is reliable and secure.
Possible uses of S3
- Transfer large files
- Image hosting for websites (I would recommend that S3 is used in conjunction with CloudFront)
- Many more…
Hopefully that list has whet your appetite and shown you some of the possible uses of S3. So how much does it cost?
Amazon S3 has a ‘pay as you go’ pricing structure with no upfront costs. This sounds easy, right? Although Amazon’s pricing structure isn’t difficult to understand it does have a few costs that can catch you out. Firstly, you need to be aware that the price varies based on the region the data is stored in (for more information on regions take a look at the AWS Availability Zones & Regions article). The pricing is separated into the following:
- Storage – this is the obvious cost
- Prices start at $0.095 per GB a month (US East Region)
- PUT, COPY, POST or LIST requests – you have to pay for each individual request you make to S3. It is therefore cheaper to store 1 large file compared to several smaller files
- $0.01 per 1,000 requests
- GET requests – this is the cost per item that is retrieved from S3
- $0.01 per 10,000 requests
- Bandwidth – you have to pay to transfer the data to and from AWS
- Prices vary but are approximately $0.120 per GB
*Prices correct at the time of writing
Hopefully all that information hasn’t put you off using S3. Don’t forget that Amazon offers a free usage tier for new customers that includes 5GB of storage and 20,000 GET requests per month.
I would certainly advise that you work out the costs prior to using S3. The pay as you go pricing model is very attractive but it can have its draw backs. For example if you use S3 for image hosting for your website you could easily spend $10 in a month on GET requests alone. I speak from personal experience when I say keep an eye on your bill.
I am assuming that you have already got an AWS account setup. If not, head over to http://aws.amazon.com/ and signup for free (you will need to enter your credit card details).
When you have logged into the management console go to the S3 menu item.
In the top left of the window click ‘Create Bucket’. (A bucket is essentially a folder and contains objects).
For this example I will pretend that I’m setting up S3 as a store for some family photos. Every bucket must have a unique name eg. ‘familyphotos123’. Also select the region you would like to store the photos.
Next click ‘Create’.
With the bucket selected you can adjust the permissions and other settings.
When you are ready to upload files to the bucket double click its name. Then use the upload button in the top left to start uploading files.
Click ‘Add Files’ and select the desired files.
Then click ‘Start Upload’. This can obviously take some time depending on the number of files selected. If you need to download the files at some point in the future, right hand click on the desired file and click ‘download’.
You now know how to upload and download files stored in Amazon S3.
If you would prefer to use a desktop application to manage your files in S3 there are a number of free and paid options available:
Another option is to use S3cmd, a command line client for S3. This is particularly useful if you use Linux and want to setup a cron job to schedule an automated backup to S3.
I hope that you have found this guide useful. I haven’t been able to cover all the features of S3 but if you have any questions, or would like to request an article/guide, leave a comment below.