Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    6

    Unanswered: Is Storing Images in MSSQL feasible?

    Hi,

    I need to know if storing images in the MSSQL database is a viable option when compared to having them in a different directory and only storing their location or address in the DB.

    I ask this with reference to the performance of the DB. Will having many images of huge size on the databse make it slow for retrieval as the MDX or database file size would eventually increase?

    Does the size of the database file has to do anything with MSSQL query performance?

    Comments on this will be appreciated.

    Thanks
    Last edited by jollyguy; 09-21-05 at 07:21.

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    store the location and file name. You will bloat your database and retrieving the images will not be as efficient. When you store image data, it is not really in the "row" but the row contains a link to another location inside the database. The main issue for me, and I have a lot of image data and I get loads of new ones all of the time, is capacity. By putting the images on a huge file server I avoid the issue of having to buy bigger and bigger machines to put sql server on and having to migrate my databases as a result.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Mar 2004
    Posts
    6
    Thanks for the reply. I too follow the same approach, but would like to know if storing the images in the db does affect its performance. I mean when we query the db will the result sets hving image data in them load on the ram and make accessiblity slower. OR Does a huge .mdx db file make query responses slower.

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    SQL Server is basically designed to work with small bits of data (rows of tables). Start throwing in large image data, and you get into some interesting memory errors at times. Let me see if I can dig out one of my old threads.....

  5. #5
    Join Date
    Apr 2005
    Posts
    67
    Hi,

    Consider this:

    Pages are mapped with "bitmaps" (or allocation pages) for various purposes.
    These maps are designed to follow a "pyramid"-type structure, with a single page pointing to children pages that point to .... and so on. Generally speaking, anything past a three-level map begins to degrade performance. This is true for index levels also.

    What was said above about bloating the database and the design for small(er) rows is accurate.

    You will have issues with: Backups, Consistency Checks, Migrations, etc. Any table scans will have to grind past the image pages, etc. etc.

    'Nuff said?

    Good luck!

  6. #6
    Join Date
    Mar 2004
    Posts
    6
    Thanks guys for your valuable input. MCrowley can you please send me links to your other posts as mentioned.

    I too am of the same idea and was trying to prove my point to some people who think storing images in a database does improve performance and maintain data integrity (as if the folder locations can change if you simply store the address of the image).

    Regards
    Last edited by jollyguy; 09-21-05 at 07:21.

  7. #7
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Sorry. Looks like it might have been lost in the latest troubles here.

Posting Permissions

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