Book Image

Amazon S3 Essentials

By : Sunil Gulabani
Book Image

Amazon S3 Essentials

By: Sunil Gulabani

Overview of this book

Amazon Simple Storage Service (Amazon S3), provides developers and IT teams with secure, durable, and highly-scalable object storage. Amazon S3 is easy to use, with a simple web services interface to store and retrieve any amount of data from anywhere on the web. S3 is automatically web scalable and responds to the requirements of your application and traffic, and therefore offers a key element to help companies deal dynamically with any spike in traffic for their application (such as a free e-book offer). This book starts with the basics of the Amazon S3 and its features, and you will quickly get an understanding how to use the Amazon Management Console for Amazon S3 which is the simplest way to manage Amazon S3. Next, we will cover basic operations on bucket, folder, objects. Once the basic operations are understood, you will know how to use Amazon S3 using Java SDK. Following that, you will learn about Copy Objects and Multipart copy objects for large objects size. You will also learn to manage the life cycle of bucket and how to share resources to the different domain by configuring CORS. The book will then guide you through the development and deployment of a static website on Amazon S3 using different services of Amazon. By the end of the book, you will be able to create a scalable application using Amazon S3.
Table of Contents (12 chapters)

Basic concepts of Amazon S3


Let's take a look at the basic S3 concepts:

Buckets

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.

Objects

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:

  • HTTP GET interface

  • BitTorrent protocol

The bucket can consist of any type of object, be it a PDF, text, video, audio, or any other kind of files.

Keys

While creating an object, a key will be assigned to the object. This key will be used for retrieving the object. The key should have the following features:

  • Be unique in the bucket

  • Contain alphabets, numbers, and special characters such as-, !, _, ., *, ', (, and )