I’ve been playing with Amazon’s Simple Storage Service for several months now. In case you’re not familiar with S3, it’s a storage service for files or any kind of data that you want to put out there. The data can be kept out on Amazon’s servers for your personal use, or you can make them publicly available. For example, for some of my installed programs or content on my website, I store the static data, downloads, and other support files out on the Amazon S3 service. My web server on my shared hosting account is only used for application logic and processing requests. The static data is getting downloaded from (or will be downloaded from soon) the Amazon S3 servers. The benefit to this is that I can take advantage of the lower cost bandwidth fees and pay-for-what-you-use space on Amazon’s servers, and I can keep the main web application server for doing the more complex operations. Plus, in the future, I can expand and take advantage of Amazon’s CloudFront content delivery network to serve my content faster depending on where in the world people are located and viewing my web site.
Amazon’s S3 service has two APIs for interacting with the service and uploading or downloading data from the storage service. The first API is SOAP-based web services, and in the past this would have probably been the preferred way of interacting with S3. However, with .NET 3.5, the REST-based APIs are simple to implement and very easy to use. Over the next several posts, I’ll be showing you how to interact with different Amazon S3 services in order to store and retrieve data. I’ll also be explaining more about how I’m planning on utilizing S3 storage for the new web site that I’m building using Umbraco.
In this first post, I’ll show you how to connect to the Amazon S3 service to view the list of buckets associated with an account. For those new to the concepts of S3, S3 works by storing objects in buckets. A bucket might be similar to a disk drive, for example. It’s a place where you’re going to build a file system and store files. An object is a file or a BLOB. It’s basically a large group of bytes that can be anything that you want. With your Amazon S3 account, you can create any number of buckets that you want for different purposes, and you can store as many objects as you want in your bucket. Once the objects are in a bucket, they can be accessed over HTTP (or HTTPS) because Amazon S3 supports basic web server-like features.
More...