Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Should heavy binary files not be stored in database?

I was asked an interesting question: Should a database contains all data? Or heavy binary files should be stored in file system?

Example of heavy binary files : videos or heavy pdf files (+200 MB)

With an old aspx web app (1.1) I tried to open a 200MB pdf file stored as a blob in an Oracle 11g database, and it just couldn't do it.

However, same asp.net web application had no problem to open same pdf file stored in file system of a server.  It could be that maybe there is some proper way to open heavy blobs fields with asp.net.

For integrity reasons, I say that all data should be stored in database, but my described case showed me that maybe it's not the way.

I read once that if your web application goes to cloud, then it would be very difficult to keep references of files stored in file system (file paths like: ../MyFolder001/MyFile.mpg), since you don't know where those files will be distributed.

What do yo think?
0
miyahira
Asked:
miyahira
1 Solution
 
slightwv (䄆 Netminder) Commented:
I'm with you on the integrity issue.  That is why my vote is to store things in a database.

It is also an integrity issue for backup and recovery.  If things are stored externally, you need some process to ensure you have everytihng you need in some consistant manner.

>>With an old aspx web app (1.1) I tried to open a 200MB pdf file stored as a blob in an Oracle 11g database, and it just couldn't do it.

What happened?  Did it generate an error, catch fire, ???

My guess is it ran into a memory issue.

Personally I've never tried to bring a file that large across a .Net app but I don't see why it would have an issue.  Biggest we've ever done here is in the 20 to 30 meg size.

Worst case, create a tmp file from inside the code to store it on the web server, then use it?

check out: Path.GetTempFileName
http://msdn.microsoft.com/en-us/library/system.io.path.gettempfilename(v=vs.71).aspx
0
 
Kamal KhaleefaInformation Security SpecialistCommented:
Hi

"SQL Server 2008’s new FILESTREAM support combines the benefit of accessing LOBs directly from the NTFS file system with the referential integrity and ease of access offered by the SQL Server relational database engine."

also see these url about storing files in sql DB VS FileSystem
http://www.dofactory.com/topic/1379/best-practice-store-images-in-db-or-on-file-system.aspx

http://webmasters.stackexchange.com/questions/940/serving-images-out-of-sql-server-vs-file-system-vs-s3-etc
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now