We're looking for a scalable way to implement a file browser feature backed by a robust object storage system for the files. We were looking at an S3 compatible service, such as MinIO for this. Since these files will be accessed by other features as well, we thought of giving these objects immutable unique ids, independent of the folders in which they appear in the file browser.
Most S3 storages don't seem to support file paths but tend to promote using the a path structure as the key. Unfortunately, the keys will not be immutable when files would be moved in the file browser. While we could work around this and not have immutable keys, it would be less ideal.
On the other hand, this wouldn't allow us to have empty directories in the file browser. A workaround for this could be to have a hidden file in every directory, but that feels a bit like a hack.
We were thinking of just generating a unique id per upload and keep a list of paths with the objects ids they point to, in another database. From this, we could build up the directory structure and display the file browser. Renaming files and folders wouldn't interfere with the existing keys, so other features can still access the files, independent of their file path in the file browser.
Would this be a valid approach or are there other ways to implement this? Maybe there are even existing solutions out there that we're unaware of, we'd love to hear.