Solved

Should heavy binary files not be stored in database?

Posted on 2013-01-28
2
198 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 76

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

840 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