I have pretty regular table users
(id, login, password). And each user can upload pdf files (which must be less than 2 mb). That is reflected in table users_pdf
:
id | pdf | user_id
---------------------
1 | some_pdf| 1
2 | pdf2 | 1
3 | pdf3 | 3
Well, the question is: should I store filepaths to pdfs in pdf
column, or real pdf files instead?
If I would store paths, that means dealing with file system folders, and it could be very painful sometimes (with backups, for example). If I would store files in the database itself, it will be slow, especially if the table will have a million entries or so, right?
So, what would you advise?
UPD. work with filesystem means folder per user, like
-users
|----user_id_1
|--file.pdf
|----user_id_2
|--file.pdf
|--file.pdf
|----user_id_3
|--file.pdf
|--file.pdf
, so if i would have like a million users, that file structure will be death slow, right?