AWS S3 (Simple Storage Service) - ilya-khadykin/notes-outdated GitHub Wiki

Advantages of Amazon S3

  • automatic scaling
  • 99.9 uptime (highly reliable)
  • built-in security (allows you to create ACLs on object level etc)
  • can be used to host static websites (files can be mapped to a domain)
  • pay for only what you really store
  • integration with other Amazon services (Amazon Elastic Compute Cloud (Amazon EC2), Amazon Elastic Block Storage (Amazon EBS), Amazon Glacier)
  • store files of any size
  • Torrent tracking and seeding
  • sharing the data with a temporary URL
  • access logging
  • file versioning
  • supports encryption

Amazon S3 concepts

Bucket

Files (objects) are stored in buckets Bucket features:

  • bucket name should be unique across all users
  • bucket cannot contain other buckets, but it can contain nested folders and subfolders
  • limit of 100 buckets in a single account

Buckets can be managed via:

  • REST-style HTTP interface
  • SOAP interface

Buckets can be accessed via HTTP URLs:

http://< BUCKET_NAME>.s3.amazonaws.com/< OBJECT_NAME >
http://s3.amazonaws.com/< BUCKET_NAME >/< OBJECT_NAME >

Objects

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

Keys

While creating an object, a key will be assigned to the object. This key will be used for retrieving the object.

Amazon S3 Use Cases

  • file hosting
  • storing data on mobile-based applications
  • static website hosting
  • video hosting (can be used for video streaming)
  • backups (Amazon S3 can also be configured to move the old data over to Amazon Glacier for archiving, as the Glacier costs less as compared to S3)

Bucket operations

Consider the following during bucket creation:

  • choose the region you want
  • enable versioning if required
  • enable logging if required (to the other bucket as recommended)
  • enable encryption if required

Accessing Objects in S3 Bucket using AWS Java SDK

  1. Download AWS SDK for Java - http://aws.amazon.com/sdk-for-java
  2. Get access and secret keys by setting up a new AWS user in AWS IAM (Identity & Access Management)