The Amazon Simple Storage Service (Amazon S3) is an online object storage. It can be used to store and get any data via the following:
REST web service interface
SOAP web service interface
BitTorrent
Amazon S3 is easy to configure, and is a reliable and scalable storage that stores files (objects) at a nominal pricing along with high security. Neither the developers nor the system team have to worry about the data that is stored at or retrieved from Amazon S3. Amazon S3 manages the Web-Scale computing by itself.
The following concepts will be covered in this chapter:
The need for S3 and its advantages
Basic concepts of Amazon S3
Features of Amazon S3
Security
Integration
Use cases
Amazon S3 can be used for storing data for application usage as well as for backing up and archiving the data. It doesn't bind the files to be stored. We can store any file, which are treated as objects, in Amazon S3. Amazon uses S3 to run its own global network of websites (http://docs.aws.amazon.com/AmazonS3/latest/dev/Welcome.html).
We can store as much data as we want in Amazon S3; it doesn't restrict a user from storing any. Amazon charges the user for the storage that is actually used. So, it is quite inexpensive for the user, because he/she doesn't need to purchase storage externally.
Amazon S3 keeps the redundant data across multiple data centers for high scalability. The user can select the region where his/her data will be stored. This reduces the latency in storing and retrieving the data. Amazon S3 also offers security on the objects. The user can make the object publicly or privately accessible. We can also store encrypted data in Amazon S3, and it guarantees a server uptime of 99.9 percent.
Amazon S3 can be integrated with any application or services offered by Amazon, such as Amazon Elastic Compute Cloud (Amazon EC2), Amazon Elastic Block Storage (Amazon EBS), Amazon Glacier, and so on.
Subscribing to Amazon S3 is free, and you just need to pay for the bandwidth that you use and for whatever you are actually hosting. Small start-ups usually don't have an infrastructure to store their huge amount data. So, they opt for Amazon S3 to store their images, videos, files, and so on to minimize the costs.
Amazon S3 also provides website hosting services. You can directly upload your pages in Amazon S3, and map it to your domain.
Let's take a look at the basic S3 concepts:
A bucket is a container in Amazon S3 where the files are uploaded. For using Amazon S3 to store a file, you need to create at least one bucket. Files (objects) are stored in buckets.
The following are a few features of buckets:
The bucket name should be unique because it is shared by all users.
Buckets can contain logical nested folders and subfolders. But it cannot contain nested buckets.
You can create a maximum of 100 buckets in a single account.
The bucket name can contain letters, numbers, periods, dash, and the underscore.
The bucket name should start with a letter or number, and it should be between 3 to 25 characters long.
Buckets can be managed via the following:
REST-style HTTP interface
SOAP interface
The following bucket looks similar to the Amazon S3 bucket to which we will upload files (objects):

A bucket doesn't have any size restrictions for the user. It can store objects of any size.
Buckets can be accessed via HTTP URLs as follows:
http://< BUCKET_NAME>.s3.amazonaws.com/< OBJECT_NAME >
http://s3.amazonaws.com/< BUCKET_NAME >/< OBJECT_NAME >
In the preceding URLs, BUCKET_NAME
will be the name of the bucket that you provided while creating it. And OBJECT_NAME
will be the name of the object that you provided while creating the object.
An object is a stored file in Amazon S3. Each object consists of a unique identifier, the user who uploaded the object, and permissions for other users to perform CRUD operations on it. Every object is stored in a bucket.
Objects can be managed via the following:
REST-style HTTP interface
SOAP interface
Objects can be downloaded via the following:
The bucket can consist of any type of object, be it a PDF, text, video, audio, or any other kind of files.
