Amazon S3 provides a simple web services interface that can be used to store and retrieve any amount of data, at any time, from anywhere in the cloud.
It provides a secure, reliable, scalable, insanely inexpensive and last but not the least “pay only for what you use” service, which has attracted many businesses, small to enterprise.
At Amazon’s first AWS re:Invent conference in Las Vegas, Amazon Web Services Vice President Andy Jassy announced that its S3 storage service now stores a total of 1.3 trillion objects and handles over 830,000 requests per second.
I will go over each step from helping you set up your Amazon S3 account, to working with files.
Create an AWS Account
First step is to create an account.
Keep your credentials in a safe place
You will need three things:
- Account Name
- Access Key ID
- Secret Access Key
Install S3 Explorer
Install a compatible S3 browser for your platform – OS, Mac, Windows. If you are using Windows 7, you can use s3browser.com.
After you login, you can create your bucket (Folders) and upload files to it.
Set up .NET environment
Now that S3 is configured, we can move forward and set up our .NET environment to work with it. Therefore, the next step is to download the S3 SDK for .NET
1. Go to http://aws.amazon.com/sdkfornet/
2. Click on AWS SDK for .NET
Add connection string
Add the key to your App settings:
Create an object
Now, you can create an object for Amazon S3 and work with it to upload and download your files.
A bucket is similar to a root folder where you can put your files.
To create a file in Amazon S3, we need the following information:
- Key: it is essentially the file name. It must be unique, and should include the folder path, like a physical address in Windows.
- Body: it is the content of the new file.
You can download files to a bucket using the code below:
Now you are well on your way to using Amazon’s S3 storage service and leveraging the resiliency and scalability of the cloud. In my next post I will be talking about Microsoft Azure cloud storage and we will see some key differences between the two. So stay tuned…