Solved

Should heavy binary files not be stored in database?

Posted on 2013-01-28
2
199 Views
Last Modified: 2013-01-30
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
Comment
Question by:miyahira
2 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 38828416
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
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 38829884
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 69
asp.net web application 3 45
disable data migrations in visual studio 2017 4 48
Oracle programming for starter 14 32
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question