Storage of files, in database or disk? [duplicate]

1

I'm developing an intranet system, with a file storage module (exclusively PDF).

What do you tell me about the storage location, save to disk on the server or database?

Remembering that it is an intranet. The server is on the same network, and the database is ORACLE. Both backed up.

If possible, argue the choice (In terms of performance, data security, etc.)

    
asked by anonymous 23.06.2017 / 19:53

2 answers

3

Normally it is not a good idea to store large binary files in the database, it is best to save their location reference given the overhead, access speed, number of hits, file size, and the like.

Why store in the database:

  • ACID properties are guaranteed, including making Rollback of a update , which is very complicated when the information is stored outside of the database.
  • The file always has a "Parent"
  • Bank backup already ensures 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 size of the PDF you will have to do a little magic = [

  • File management in the database is relatively more complex than disk management and according to the number of data in the need greater knowledge about classification of files, indexes and the like.

  • File portability, because the PDF format is "universal", which can not be said for DB's FileStream

  • Depending on the chosen bank the connection to upload and download files may give a small headache to some problems already known to each bank

  • If you upload to the Web, you have to implement a FileStream handler and this takes much more time and knowledge technical as well as being a failure factor

  • You can not use the cloud for possible scalability of the system

I recommend creating the following scheme:

____________________________________________
| ID | TIME | QUERY | PDF_NAME | PDF_FILE  |
|----|------|-------|----------|-----------|

Important to note that if you prefer to use a DB it is much more advisable to use FileStream than a Blob for performance reasons. This reading will help you understand FileStream, Blob, and Varbinary

This is the SOURCE , but I changed some concepts for your purpose =]

Edit : Oracle uses BFile as type and not FileStream

    
23.06.2017 / 20:20
-1

Hello, Home Software performance is the same in both cases according to oracle in the text also shows about the various ways to display or load the database files.
It depends a lot more on how much performance your machine has to process the data. keep only the file link in the database.

    
23.06.2017 / 20:22