For Amazon S3 request rates, what's the difference between prefixes and nested folders? How many prefixes can I have in an S3 bucket?

Last updated: 2021-07-23

For Amazon Simple Storage Service (Amazon S3) request rates, what's the difference between prefixes and nested folders? How many prefixes can I have in an S3 bucket?

Resolution

Prefixes

A prefix is the complete path in front of the object name, which includes the bucket name. For example, if an object (123.txt) is stored as BucketName/Project/WordFiles/123.txt, the prefix is “BucketName/Project/WordFiles/”. If the 123.txt file is saved in a bucket without a specified path, the prefix value is "BucketName/".

A partitioned prefix in a bucket can support 3,500 PUT/COPY/POST/DELETE or 5,500 GET/HEAD requests per second. There is no limit to the number of prefixes you can have in a bucket.

Note: In Amazon S3, there are no partitions for keys or objects. Partitions exist only at the prefix level, and not at the object level. For more information about using prefixes in Amazon S3, see Organizing objects using prefixes.

Folders

A folder is the value between the two "/" characters. For example, if a file is stored as BucketName/Project/WordFiles/123.txt, the file path indicates that there is a folder ("Project") and subfolder ("WordFiles"). Both "Project" and "WordFiles" are considered to be folders. If the 123.txt file is saved in a bucket without a specified path, then no folders are used to store the file.

In Amazon S3, folders are used to group objects and organize files. Unlike a traditional file system, Amazon S3 doesn't use hierarchy to organize its objects and files. For the sake of organizational simplicity, Amazon S3 console supports the folder concept as a means of grouping objects.

Note: The folder structure might not indicate any partitioned prefixes that support request rates.

Difference between prefixes and folders

The difference between a prefix and a folder is the significance of the "/" character. For folders, the "/" character signifies a subfolder or object name. For prefixes, "/" is just another character. The "/" does not indicate a partition placement.

Meanwhile, you can create a prefix the programmatically, using either the AWS Command Line Interface (AWS CLI) or Amazon SDKs. When you create a prefix using these methods, Amazon S3 doesn't treat the prefix as an object, nor does it hold any size. For more information about the difference between folders and prefixes, see Organizing objects in the Amazon S3 console using folders.