0

I have a table to save file. Table looks like this:

    ---File Table---
    FileId
    FileName
    File (File path or Binary Data)
    FileTypeId
    -----------------------------

--- FileType Table---
FileTypeId
FileTypeName Eg: pdf, xlxs
-----------------------------

I am going to have a huge number of files stored like this.

Should I create different table for Pdf, xlsx, doc, ppt, etc file? Or should I continue like above?

Note that I am talking about best way to retrieve file.

And also, should i save file in database as binary data type, or should I save the paths to file?

So to summarize again:

  • What is the best schema to retrieve file?
  • What is the best schema to store file?
  • Should I save path to directory or save file as binary data?
  • What is the optimum way for both retrieval and storage?
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Prabesh
  • 353
  • 1
  • 6
  • 20

1 Answers1

0

The fastest way would be to store files in directories. And then store the file path inside the database. Especially if you have a lot of payloads.