Results 1 to 14 of 14

Thread: [RESOLVED] Experienced Programmers - Question

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Resolved [RESOLVED] Experienced Programmers - Question

    Here is my question to those who can relate:

    I have heard over and over again to NOT store pictures in a blob on a server, because it can bog down the server in a hurry if many users are using the application.

    But.. how does this really come into play? If I have 500 images on my server, will that bog it down? Will it only be a problem if say, under 10 people, are accessing the server at once?

    Can someone put this into a real-world example? Thanks!!

  2. #2

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Experienced Programmers - Question

    it also depends on what the images are and for what. Is this a web app? or is it for a windows app? are we talking about images that are in the Megs big? Or are we talking about Icons?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Experienced Programmers - Question

    this is a windows application that will create the image and then store it on an online server to view the image from home.

    average gif size is 22 kb.

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Experienced Programmers - Question

    I would just store image path in the database - 20 KB is not munch at all, however it would d still require some time to extract image regardless of methodology (extracting to a file or converting on-the-fly).
    On the other hand getting image from the hard drive could be almost instantaneous.
    Btw, if there is a value then your images may need to be copyrighted with appropriate and distinct message for those who will be viewing.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Experienced Programmers - Question

    thanks Rhino. With my specific application, the image from the windows application *needs* to go on an online server.

    I hesitate to reference the image path online, because of how confidential the image is, if viewed by someone else.

    Hence my concern for a bogged down server with these blobs. I wonder how bogged down the server can really get? I would like to plan ahead of time, that's all.

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Experienced Programmers - Question

    Benchmarking partially depends on hardware - we have multi server cluster that handles hundreds of simultaneous users without any problem what so ever.
    We store only pointers to images and video (true hd files) so streaming is extremly fast - I can't imagine what would it be to store thos large files directly in db.
    It would probably double the cpu usage I think but best way to find out is to actually clock server cpu while dozen of users try to access it.
    IMHO it's never about "best practices" but rather "what's working best under sircumstances".

    btw, if you need some sample code to save/extract file there are few links in my signature.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Experienced Programmers - Question

    thanks a lot.

    i seems trial and error is best, right? ;-)

    from what i gather, i have a decent shot at not having it too bogged down because the file size is so small.

    i doubt anymore than 12 people will use this at one time too.

  9. #9
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Experienced Programmers - Question

    Thread moved to Database Development forum (the "VB6" forum is meant for questions which don't fit in more specific forums - and for this question the programming language is almost irrelevant)

    It should be fine to store them in the database - one of my systems (using SQL Server 2000) stored many more pictures than that (and larger too), with lots more users, and there were no speed issues. However, the effects it has depends on the design of your system.

    Assuming that the pictures would otherwise be stored on the same server, the difference between storing the pictures in the database or file system is negligible - either way the disk is accessed and the data transferred, the biggest difference is that the database system will take slightly longer to find the 'file' to start with (and that will probably only add a few milliseconds per picture).

  10. #10
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Experienced Programmers - Question

    Store them in the database.

    That creates a single-suitcase for encapsulating your data that helps in disaster recovery, for instance.

    We have one client storing nearly 10,000 student pictures in a DB.

    It's even a more secure place to store them - right?

    Code:
    select sum(1),sum(imagesize) from stuphoto_t
    
    ----------- ----------- 
    9712        253859296
    
    (1 row(s) affected)
    We were actually driven to do this by the fact that we have pocket pc's that gather the images from the database during a sync operation we have. And the easiest way for a PPC to talk to a network resource is through a database connection.

    Remember - regardless of where the object is stored it still needs to come from somewhere and go through some pipe to get to your client app. Personally I see no difference in having the DB serve it to me. If I had more time I could benchmark this - but who has time...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  11. #11
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: Experienced Programmers - Question

    Personally I'd go with storing them in the DB for two reason.
    1. If you store them separately on disk your application code has to cope with orphaned references (ie some numpty has deleted the image file but the DB hasn't been updated to reflect the fact that there is no image)
    2. If you store the image on disk then you need to open up access to the disk to your application. Your application already has access to the DB server so why open up a second hole?
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  12. #12
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Experienced Programmers - Question

    For those of you "preaching" for storing images in db here is something to consider:

    - blobs degrade db performance
    - due to rapidly increasing size (when files are added frequently) backups may take longer with chance of failure
    - it's resonable up to certain size
    - absolutely not acceptible for storing movies [imho]

    ... list can go on and on ... however there is no definitive "yes" or "no" - plenty of pros and cons for either approach so as I said lots of testing has to be done before making decision.

  13. #13
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Experienced Programmers - Question

    Btw, you also need to consider DR (data recovery).
    DRs are usually done somewhere off site with network and hardware configuration all being far from their production cousins.
    So, attempt to stream live data from db may never reach the client...

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    790

    Re: Experienced Programmers - Question

    I will look into this.. Thanks!

Posting Permissions

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



Click Here to Expand Forum to Full Width