Objects, buckets and keys in object storage: how they differ from files and folders

  1. Introduction
  2. Three concepts: object, bucket, key
  3. Object
  4. Bucket
  5. Key
  6. "Folders" are just prefixes and delimiters
  7. A quick comparison with file systems
  8. Trying it on the command line
  9. A few properties worth knowing
  10. Common mistakes
  11. Summary
  12. References

Introduction

If you have used disks, network shares or a file server, you are used to the idea that "a file lives in a folder, and a folder lives in another folder". Object storage works differently.

The S3 protocol introduced by Amazon has become the most common way to talk to this kind of store, and many other products (including software you run on your own servers) speak "S3" to varying degrees.

This is the first article in a series about object storage and S3.

We will clarify the three keywords object, bucket and key, compare them with files and folders, and then run a few commands to see how the model behaves.

The later articles cover request signing and permissions, then multipart uploads, lifecycle and cost.

Three concepts: object, bucket, key

Three concepts: object, bucket, key

Object

An object consists of:

Unlike a file on a file system, an object has no "location on disk" that you can see, no chmod-style permissions, and you do not open it to write a few extra bytes into the middle.

Bucket

A bucket is the top-level container for objects. A few points to remember (according to the Amazon S3 documentation):

Buckets do not nest: you do not put a bucket inside a bucket.

Key

A key is a sequence of Unicode characters encoded in UTF-8, at most 1,024 bytes long (according to the AWS documentation). The pair (bucket, key) identifies exactly one object. For example:

bucket:  example-media
key:     2026/11/anh-bia.jpg

With that key, many tools will show a folder 2026, containing a folder 11, containing the file anh-bia.jpg.

In reality there is one object with one long key string that happens to contain / characters.

"Folders" are just prefixes and delimiters

When you list objects, the API accepts two parameters: prefix and delimiter (usually /). The store will:

  1. Filter the keys that start with prefix.

  2. If a delimiter is given, group the keys that share the same segment up to the next occurrence of / into one "common prefix", and the interface displays that group as a folder.

Practical consequences:

A quick comparison with file systems

Aspect

Structure

File system / folders

A real directory tree

Object storage (S3 style)

Flat: a bucket holds keys

Aspect

Access

File system / folders

Open a file, read/write ranges

Object storage (S3 style)

HTTP calls: PUT, GET, HEAD, DELETE

Aspect

Changing content

File system / folders

Overwrite part of it, append

Object storage (S3 style)

Rewrite the whole object

Aspect

Renaming

File system / folders

One fast operation

Object storage (S3 style)

Copy to a new key, then delete the old one

Aspect

Permissions

File system / folders

Users, groups, chmod

Object storage (S3 style)

Access policies, access keys

Aspect

Scale

File system / folders

Bounded by the disk/volume

Object storage (S3 style)

Very large, scales out

Aspect

Good for

File system / folders

Apps that need file locking, databases

Object storage (S3 style)

Images, video, backups, logs, static files, analytics data

Because writes are whole-object, object storage is not a network disk for running a database or software that makes constant small writes.

Some tools mount a bucket as a directory, but that is an emulation layer and its performance and consistency differ from a real disk.

Trying it on the command line

Suppose you have installed AWS CLI version 2 on Ubuntu 24.04 and set your access keys with aws configure. For a self-hosted S3-compatible store, add --endpoint-url.

The address below is only an example.

# Create a bucket (example name; a real name must be unique)
aws s3 mb s3://example-media --endpoint-url https://s3.example.com

# Upload a file, setting the key to 2026/11/anh-bia.jpg
aws s3 cp anh-bia.jpg s3://example-media/2026/11/anh-bia.jpg \
  --endpoint-url https://s3.example.com

# View it like a folder (prefix + delimiter used implicitly)
aws s3 ls s3://example-media/2026/ --endpoint-url https://s3.example.com

# See the metadata without downloading the content (HEAD)
aws s3api head-object --bucket example-media --key 2026/11/anh-bia.jpg \
  --endpoint-url https://s3.example.com

The aws s3 ls command prints a line PRE 11/: that is the common prefix, not a real folder. To see the mechanism, use the low-level API:

aws s3api list-objects-v2 --bucket example-media \
  --prefix 2026/ --delimiter / --endpoint-url https://s3.example.com

The JSON result has two parts: Contents (objects directly at that level) and CommonPrefixes (the child "folders").

Warning: aws s3 rm --recursive and aws s3 sync --delete delete data in bulk. Run them with --dryrun first, and double-check which bucket and prefix they point to.

A few properties worth knowing

Common mistakes

Summary

Object storage keeps objects (content plus metadata) in buckets, addressed by key; a "folder" is only a view built from prefixes.

The model is simple, scales well and suits write-once, read-many data. Remember two things: a write replaces the whole object, and renaming means copy then delete.

With that in mind, the later articles on signing, permissions and lifecycle are easier to follow.

References

Objects, buckets and keys in object storage: how they differ from files and folders