Skip to content

Feature Request: Use subdirectory structure for attachment storage (e.g., hash-based or date-based) #2308

@SoDaHo

Description

@SoDaHo

Is your feature request related to a problem? Please describe.
When uploading attachments, all files are stored in a flat directory structure (/private/table/). With thousands of files, this causes:

  • Slow filesystem operations (ls, find, backups)
  • Compression tools processing files one by one takes significantly longer
  • Potential filesystem limitations (ext4 performance degrades with 100k+ files per directory)

Describe the solution you'd like
Implement a subdirectory structure for attachment storage, for example:

  • Hash-based: /private/table/ab/cd/abcdef123456.jpg (like git)
  • Date-based: /private/table/2024/12/20/file.jpg
  • Bucket-based: /private/table/bucket-001/file.jpg

This should be configurable via environment variable, e.g. STORAGE_STRUCTURE=hash|date|flat

Describe alternatives you've considered

  • Keeping flat structure but accepting performance limitations
  • Manual reorganization via external scripts (breaks internal references)
  • Using S3/MinIO with lifecycle policies (doesn't solve the core issue)

Additional context
Currently backing up ~30GB of teable data. The compression process spends significant time iterating through thousands of individual files in a single directory. A hierarchical structure would improve backup performance and overall filesystem health for larger installations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions