Understanding AWS S3: Buckets, Objects, Keys, and Prefixes
Amazon S3 is one of the most commonly used AWS services for storing data in the cloud. When I first started learning S3, the concepts of buckets, objects, keys, and folders were confusing.
Here is a simple way to understand them.
1. What is an S3 Bucket?
A bucket is a container used to store objects in Amazon S3.
For example:
my-company-data
Inside this bucket, we might store documents, images, backups, logs, and application files.
Think of a bucket like a large storage container.
2. What is an S3 Object?
An object is the actual data stored inside the bucket.
For example:
resume.pdf
profile.jpg
server-log.txt
An object contains the data itself along with metadata.
So:
Bucket = Container
Object = File/Data stored in the container
3. What is an S3 Object Key?
Every object has a unique key that identifies it inside the bucket.
For example:
documents/resume.pdf
Here, the complete key is:
documents/resume.pdf
The key is not just the filename.
4. What is a Prefix?
The part before the object name is commonly called a prefix.
For example:
documents/college/resume.pdf
The prefix is:
documents/college/
The object name is:
resume.pdf
This helps organize objects.
5. Does S3 Have Real Folders?
This was one of the concepts I found confusing when learning S3.
S3 is a flat object storage system. It doesn't use traditional filesystem directories in the same way as a local computer.
When we see:
documents/college/resume.pdf
the / characters are part of the object's key.
The AWS console displays these prefixes in a folder-like way, which makes S3 easier to navigate.
6. Example
Suppose we have:
my-bucket/photos/2026/profile.jpg
We can break it down like this:
Bucket: my-bucket
Prefix: photos/2026/
Object name: profile.jpg
Key: photos/2026/profile.jpg
7. Why Understanding This Matters
Understanding S3 keys and prefixes becomes important when working with:
For example, a policy can be designed to allow access only to objects under a particular prefix.
Conclusion
The easiest way to remember S3 is:
Bucket → stores Objects
Object → contains Data
Key → uniquely identifies the Object
Prefix → helps organize Objects
Once these concepts are clear, many other S3 features become much easier to understand.
Loading article