If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > files in database or filesystem?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-26-05, 08:13
lutz lutz is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
files in database or filesystem?

Hello!
I'm writing a flat database table with a few hundret thousand expected element entries. A file belongs to each entry. The files will cause most of the size. Would you recommend me to store the files in the database or in the file system? How do you decide? Does your decision depends on the expected file size or another criteria?

Best regards, Lutz
Reply With Quote
  #2 (permalink)  
Old 10-26-05, 09:45
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally Posted by lutz
Hello!
I'm writing a flat database table with a few hundret thousand expected element entries. A file belongs to each entry. The files will cause most of the size. Would you recommend me to store the files in the database or in the file system? How do you decide? Does your decision depends on the expected file size or another criteria?

Best regards, Lutz
How big are the files? How will you be accessing them (ie. from what application?)

We did some analysis and decided to store some image files in our database. The big benefit was that they would be on the same filesystem as the rest of the database and would be backed up as one unit, so if there's a failure things wouldn't get out of synch.

In our case they would only be accessed through a web application server and streamed to a browser, so we coded that and we were done. You requirements might vary, it could be a pain to access the file once its there (from the application side).

And there's also network concerns, if you're constantly streaming the file data over the network from the database it could be a strain. Best to load test it to make sure everything holds together.

jono
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
  #3 (permalink)  
Old 10-26-05, 10:14
lutz lutz is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
Thank you for your reply!
Original I'm talking about small portraits in JPEG format. So probably about 100kB per file.

Another system I have to deploy will have a flat table as well but two files associated with each entry. One file will have a size of about 10MB and the second of about 500kB.

Both systems will be used by a webfrontend. The programming language/framework will be PHP, RubyOnRails or Perl.

So no general answer but to do a load test...
Reply With Quote
  #4 (permalink)  
Old 10-26-05, 10:24
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Well there's a lot of answers. It really depends.

Here's an article about it from Oracle, it suggests there's an increasing trend toward storing images in databases:
http://www.oracle.com/technology/pro..._database.html

Of course, it's from Oracle... they sell databases...

jono
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On