Buckets, Objects, and Storage Classes with S3

Learn about buckets, objects, sub-resources, and storage classes.

Buckets

Files are stored in buckets.

  • A bucket can be viewed as a container for objects.
  • A bucket is a flat container of objects.
  • It does not provide a hierarchy of objects.
  • You can use an object key name to mimic folders.

100 buckets are provided per account by default. You can store unlimited objects in your buckets. You can also create folders in your buckets (only available through the console), but you cannot create nested buckets.

Bucket names cannot be changed after they have been created. If a bucket is deleted, its name becomes available again. Bucket names are part of the URL used to access the bucket. An S3 bucket is region-specific, but S3 is a universal namespace, so names must be unique globally. The URL is in this format: https://s3-eu-west-1.amazonaws.com/.

Limitation

Bucket ownership is not transferable.

You can backup a bucket to another bucket in another account. You can also enable logging to a bucket.

Bucket naming

  • Bucket names must be at least 3 and no more than 63 characters in length.
  • Bucket names must start and end with a lowercase character or a number.
  • Bucket names must be a series of one or more labels that are separated by a period.
  • Bucket names can contain lowercase letters, numbers, and hyphens.
  • Bucket names cannot be formatted as an IP address.

Best Practice

For better performance, lower latency, and lower cost, create the bucket closer to your clients.

Objects

Each object is stored and retrieved by a unique key (ID or name).

An object in S3 is uniquely identified and addressed through:

  • Service end-point
  • Bucket name
  • Object key (name)
  • Optionally, an object version

Objects stored in a bucket will never leave the region where they are stored unless you move them to another region or enable Cross-Region Replication.

You can define permissions on objects when uploading and at any time afterward using the AWS Management Console.

The following diagram provides an overview of Amazon S3.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.