Results 1 to 4 of 4
  1. #1
    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

  2. #2
    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

  3. #3
    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...

  4. #4
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •