The explicit java web application allows users to upload files (images and documents) to their profiles and define access rules for these files (determine which other users can view / download the file). The access control / permission system is customizable, and the rules are stored in mongoDB along with the user profile and the actual file entry.
Knowing that I need the application and storage to be distributed and fault tolerant, I need to figure out which one is the best strategy for storing files.
Should I store files inside mongoDB in the file collection, where is the file containing the description and access rules?
Or should I store files inside the server file system and save the path in the mongoDB document? With the file system approach, I can still enforce user permissions and how? Finally, in the approach to the file system, how can I distribute files on different servers? Should I use dedicated servers for this or can I store files on webapp servers or mongodb servers?
Thanks so much for all your ideas! Any help or feedback is appreciated.
Alex
source share