What is the best practise for storing a large number of files that are referenced in a database in the file system?
We're currently moving from a system that stores around 14,000 files (around 6GB of images and documents) in a MySQL database. This is quickly becoming unmanageable.
We currently plan to save the files by their database primary key in the file system. I'm concerned about the possible performance issues of having that many files in the same folder. Also, these files will be inserted by several different applications on the same server.
Specifically I'd like to know:
- Is this a good solution given these parameters?
- Will it leave room to scale further in the future?
- Are there any concerns about storage of many files in the same location?
- Is there a better way to name/distribute the files?