There is not a single correct answer here, but one consideration is that the amount of data will be a problem. If it is not too large, I prefer to store them in a database for the same reason that I like to have a database with backups, consistency and the ability to restore my data. If you use a file system or even filestream, you do not back up your pdf file when backing up your database, and if you go back to another server or roll back to a previous point in time, you may end up in inconsistent pdf files and your data conditions, I am sure that it will work better, and you should definitely keep this in mind, but if performance is not a problem, of course, itโs nice to be able to restore the database to another server, even in development or and know that you have all of your data, not all of your data EXCEPT for your PDF files.
UPDATE: Martin is right, the backup data is backed up by your regular backups, and you can use the WITH MOVE option when restoring to restore data elsewhere, if necessary. Therefore, to clarify, if you use simple old pointers to files on disk somewhere, you will not have backup copies of your pdf files when backing up your database, but you will if you use filestream. You still need to be careful that the files are not modified outside the database, since the database will no longer ensure the integrity of your records, for example, the user can delete a file from the file system that indicates the stream stream, or the antivirus could quarantine the file if he was configured incorrectly. With a little planning, filestream looks like a great option for many scenarios.
source share