Got more questions? Find advice on: SQL | XML | Regular Expressions | Windows
in Search
Welcome to AspAdvice Sign in | Join | Help

Save image in Database or in web server

Last post 02-13-2008, 8:18 AM by carlcamera. 1 replies.
Sort Posts: Previous Next
  •  01-22-2008, 3:06 AM 38787

    Save image in Database or in web server

    Hi Experts,
              We are going to create Photo Printing & Social Networking site like Shutterfly.com,picsqare.com,kodakgallery.com,facebook.com.

    Everything is running fine. But Now I am facing some problems.

    When user Upload several(no limit) his/her Photo(s), I save those photo in Sql Server Database in Image datatype. & we are saving three sizes of every image. (one is original, second is thumbnail size & third one is larger then thumbnail and smaller then original)

    I have some reason to save Images in sql Server.
    1. In database it will take a little bit storage space.
    2. We can take backup easilly of whole data.

    but the main issue in this process is that we have to create images in everypage, everytime with the help of HttpHandler from byte array to image(.net datatype). & this will be a costly process when traffic will increase.

    So now i am thinking to save uploaded images in our web server & image path in sql server database.
    But in this process,there is an issue related to Image size. Because If save image physically then it will take its original size(may be in MB). Means if there are 1000 users & each user upload 20 MB data then it will take more then 1000x20 MB data.(because we have to save three sizes).

    Facebook saves 5 sizes of every image. But i dont know that how they are saving images(in database or in web server).

    Pls guide me experts !

    Regards,
    Anuj Rathi

  •  02-13-2008, 8:18 AM 39562 in reply to 38787

    Re: Save image in Database or in web server

    Whether you save a user's 20MB of image files in SQL Server or on the file system does not make the images any smaller or take up less space.  20MB is 20MB.  This means 1000 x 20MB is going to be needed somewhere -- either in a SQL Server mdb file, or on a hard disk in .jpg format.  One way to save space is to store only the largest image size, then use Http Handlers to create the smaller sizes.  The trade-off, as you might imagine, is performance.  On the other hand, you could create as many thumbnail sizes as you'd like since each one is just a different code method.  That's my perspective.

    Sincerely,

    Carl
    -----
    vine type - content management with standards in mind - vinetype.com
    -----
View as RSS news feed in XML