An object key split into area, customer, date and stable id, with the list pages needed for all 10,000 keys against one customer's 200.

An object-store bucket is not a desktop folder tree. It is a flat collection of object keys; the slash-separated ‘folders’ in clients are prefixes inferred from those names. A consistent key scheme makes browsing, lifecycle work, permissions, recovery and bulk operations less error-prone long before a bucket reaches 10,000 files.

Start with a key, not a folder

A key uniquely identifies an object. AWS’s S3 documentation sets a maximum key length of 1,024 UTF-8 bytes and notes that keys are case sensitive. The complete prefix counts toward that limit. This is plenty for normal names, but it is a reason to keep generated paths structured rather than embedding an entire URL or customer record in every filename.

text
Good general pattern
<area>/<tenant-or-project>/<YYYY>/<MM>/<DD>/<stable-id>-<variant>.<ext>

Examples
media/acme/2026/11/01/01jb8f4q-original.jpg
exports/acme/2026/11/01/invoice-9482.csv
backups/site-a/2026/11/01/postgres-0200.sql.gz

Why the date comes before the filename

S3-compatible listing APIs select objects by prefix and return key names in UTF-8 binary order. A zero-padded YYYY/MM/DD prefix therefore makes ‘all files for 1 November’ a direct prefix query and makes chronological browsing natural. Put the lowest-cardinality grouping first: an area such as media, exports or backups; then a tenant or project; then time. Put a random or stable identifier after the part you need to browse.

QuestionKey designPrefix to list
Restore one website on a datebackups/site-a/2026/11/01/…backups/site-a/2026/11/01/
Find one customer's exportsexports/acme/2026/11/…exports/acme/
Purge generated thumbnailsmedia/acme/2026/11/…-thumb.webpmedia/acme/ plus a suffix filter in your app
Keep originals and derivatives separateoriginals/… and derivatives/…originals/ or derivatives/

The 10,000-file example

Suppose an app creates 10,000 images in one month for 50 customers: 200 per customer. With media/<customer>/2026/11/<id>-original.jpg, a customer browse begins with one bounded prefix instead of scanning the whole collection. Listing is still paginated: AWS documents up to 1,000 keys per list response. A full bucket scan of 10,000 objects needs at least 10 pages; one 200-object customer prefix can fit in one page. Always implement the continuation token even when the first data set is small.

text
10,000 objects ÷ 1,000 keys per page = at least 10 list pages
200 objects for one customer ÷ 1,000 = 1 page

Pseudo-code
next = null
do:
  page = list(prefix=media/acme/2026/11/, continuation=next)
  process(page.objects)
  next = page.next
while next is not null

Use characters that survive tools and URLs

Use lowercase letters, digits, hyphens, underscores and periods for generated segments; use / only as a delimiter. AWS calls alphanumeric characters, !, -, _, ., *, apostrophe and parentheses generally safe. It specifically warns that spaces and URL-sensitive characters can require special handling, and recommends avoiding period-only . and .. path segments because applications may normalize them.

Avoid in generated keysReasonSafer replacement
Spaces and repeated spacesURL and copy/paste handlinghyphens
./ or ../ segmentspath normalizationa named segment such as previous
%, #, ?, bracketsencoding or URL fragment/query meaninglowercase words and hyphens
mixed-case identifierskeys are case-sensitiveone lowercase convention

Keep human labels out of the only identifier

A filename like final-final-v7.jpg cannot reliably tell an app whether it is unique. Use an immutable ID and retain a human display name in object metadata or your application database. If a path has to be public, avoid personal data, email addresses and secrets in the key: a public URL often exposes the key itself. Changing a key is normally a copy-and-delete workflow, so treat key design as part of the data model.

A migration you can stop safely

  1. Write the new key rule and test it with 20 representative files, including non-ASCII filenames and files with spaces.
  2. Copy objects to the new prefix; do not delete the originals yet.
  3. Compare object count, total bytes and a sample of hashes or checksums.
  4. Point new writes at the new prefix and update readers that know the old paths.
  5. After a documented retention period and a restore test, delete only the verified old prefix.

The existing rclone backup guide is a good way to copy and check a migration. If you are configuring a client for an S3-compatible endpoint first, read S3-compatible storage explained.

Use organized buckets with familiar S3-compatible clients.

Explore tport.space

Sources checked 1 November 2026