How to organize the storage of user files?

There is a need to allow the user to make investments, how best can it be done? create a maze of folders ? or in the database?
June 3rd 19 at 19:35
3 answers
June 3rd 19 at 19:37
file, FS, path in DB
June 3rd 19 at 19:39
in the General case - "the maze" (although everything is transparent) from folders
And what a great sense to create a billion invested folders for the files? - Danielle commented on June 3rd 19 at 19:42
June 3rd 19 at 19:41
* Storage: the size of the attachments. If a "small" database. But if large, then FS (or it will fill up). Or each user Stoi file allotment or partition.
* Security: If the DB is on you can get or modify it (usually). If FS or implementation on the software (it was impossible to get out of it) or Forosa to filter queries.
* Access: system symbolic links allows you to organize the directory search is not worse than in the database.
She quickly filled, and for every hundred people has its own folder for every 10 000 has its own folder with 100 folders and so on, + the folder of each user divided by the types of files... Files/video/audio/photo - Danielle commented on June 3rd 19 at 19:44

Find more questions by tags Web Development