Normally it is not a good idea to store large binary files in the database, it is better to keep the reference of their location given the overhead, access speed, number of accesses, file size and the like.
Why store in Database:
- ACID properties are guaranteed, including making Rollback of a
update, which is very complicated when the information is stored outside the database.
- The file always has a "Dad"
- Bank backup already ensures that binaries will be saved
Why save to Disk:
The size of binary files varies for each database when
if Filestream is used, depending on the PDF size you will have to do
a little magic =[
File management in the database is relatively more
complex than managing on disk and as the number of data on
a greater knowledge of the
files, indexes and the like.
File portability as the PDF format is "universal", which
cannot be said for DB Filestream
Depending on the bank chosen the connection to upload and download
files can give a small headache to some problems already
known to each bank
If an upload is made to the Web, you have to implement a
Filestream Handler and this takes much more time and knowledge
technical as well as being a factor of failure
You cannot use the cloud for a possible scalability of
system
I recommend creating the following scheme:
____________________________________________
| ID | TIME | QUERY | PDF_NAME | PDF_FILE |
|----|------|-------|----------|-----------|
Note that if you prefer to use a DB it is much more recommended to use Filestream than a Blob for performance reasons.
That reading will help you understand Filestream, Blob and Varbinary
That’s the SOURCE, but I changed some concepts for its purpose =]
Edit: Oracle uses Bfile as type and not Filestream
See if the answers here resolve your doubt: https://answall.com/questions/12687/
– bfavaretto