Solved

Should heavy binary files not be stored in database?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now