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?