Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
S3 — Object Storage  ›  Lesson

Buckets and Objects

Buckets / Objects 14 minS3 stores objects, each a key plus its bytes and metadata, inside buckets that live in one Region and have globally unique names, and folders are only prefixes in the keys.

Buckets and Objects

Inkwell has twelve thousand book cover images sitting on the web server's disk. The disk keeps filling up, backups are slow, and each new web server needs its own copy. Amazon S3 (Simple Storage Service) takes files off servers entirely: any server, and with permission any browser, can fetch them from one place.

The rule

A bucket is a globally named box in one Region; an object is a key plus bytes.

A bucket is a container for objects:

  • It lives in one Region that you choose, such as ap-south-1.
  • Its name must be unique across all AWS accounts, not just yours, because it appears in URLs. Names are 3 to 63 characters of lowercase letters, numbers, dots and hyphens, starting and ending with a letter or number.

An object is a stored file:

  • The key is its full name within the bucket, such as covers/2026/the-river.jpg.
  • The data is the bytes of the file.
  • Metadata describes it, such as Content-Type: image/jpeg.

S3 has no real folders. The namespace is flat, and the console just splits keys at / to show folders. covers/2026/ is a prefix shared by keys.

aws s3 cp the-river.jpg s3://inkwell-covers/covers/2026/the-river.jpg
aws s3 ls s3://inkwell-covers/covers/2026/

Other facts worth owning:

  • S3 is designed for eleven nines (99.999999999%) of durability, by storing data redundantly across multiple Availability Zones for most storage classes.
  • Reads are strongly consistent: once an upload succeeds, the next read returns the new object.
  • Versioning, switched on per bucket, keeps every version of an object, so an overwrite or delete can be undone.

The shortcut

Split any S3 address at the first slash after the bucket: everything before is the bucket, everything after, slashes and all, is the key.

Reading s3://inkwell-covers/covers/2026/the-river.jpgStep 1 of 3
  1. Drop the scheme

    Remove s3://, leaving inkwell-covers/covers/2026/the-river.jpg.

The trap is treating prefixes like folders. "Renaming a folder" in S3 means copying every object under the old prefix to a new key and deleting the originals. Choose a sensible key layout at the start.

Drills

Answer fast — trust the rule.

quick drill

In s3://inkwell-covers/covers/2026/the-river.jpg, what is the key?

quick drill

Which is a valid bucket name?

quick drill

Inkwell tries to create bucket bookcovers, but another company already owns that name. What happens?

quick drill

Versioning is on and a developer uploads a new the-river.jpg over the old one. What happens to the old image?

Remember

  • A bucket is a globally named box in one Region; an object is a key plus bytes and metadata.
  • Split an S3 address at the first slash after the bucket: bucket before, key after.
  • Trap: folders are only prefixes; renaming one means copying every object.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainTake apart an S3 address

Inkwell stores a cover at s3://inkwell-covers/covers/2026/the-river.jpg in the Mumbai Region. Name the bucket and the key, explain whether a folder called covers/2026 really exists, explain why Inkwell could not name its bucket Inkwell_Covers, and say what versioning would do if a developer uploads a new file with the same key.