That’s mostly because it doesn’t have real directories, it just simulates them with string prefixes and if you forget that on large buckets you are going to have a bad time.
Imagine you have dir1/dir2 with “directories” inside, each one with millions of “files”/objects. When you try to “ls” the dir1/dir2 by querying Prefix='dir1/dir2/' and Delimiter='/' S3 will still scan all the millions of objects starting with the prefix, and then filter out the ones that have a / after the prefix.
There’s no benefit or drawback on it’s own. The way the keys and queries work are geared to S3’s nature as a key value object store - which requires it to support keys that wouldn’t be valid file paths or that have different delimiters.
That’s mostly because it doesn’t have real directories, it just simulates them with string prefixes and if you forget that on large buckets you are going to have a bad time.
What makes that different from a “real directory”?
Imagine you have
dir1/dir2with “directories” inside, each one with millions of “files”/objects. When you try to “ls” thedir1/dir2by queryingPrefix='dir1/dir2/'andDelimiter='/'S3 will still scan all the millions of objects starting with the prefix, and then filter out the ones that have a/after the prefix.And the benefit of this is …
There’s no benefit or drawback on it’s own. The way the keys and queries work are geared to S3’s nature as a key value object store - which requires it to support keys that wouldn’t be valid file paths or that have different delimiters.