in reply to Re: Is it a good idea to store images in a RDBMS?
in thread Is it a good idea to store images in a RDBMS?

Your embedded images and sound will be accessed via HTML tags, rigth? Consider, that if you store them in database, you will need to extract them into temporary files each time you neet to generate page containing them. So you need to find the filename of .gif file stored in DB, extract large binary contens and write it to temporary file, and delete afterwards. Looks like potential bottleneck for me.
But, if you store in your DB just file name, you need just print filename into proper HTML tag, what you are doing anyway.
But, as tadman noted, too much files in one directory can slow you down, too.
This leaves you with spreading them into many directories. How to do it most efficiently?
This was also asked here, one smart proposal what I liked was to place file foo.gif into /f/fo/foo.gif. Straightforward and error-prone, even if file is moved into wrong directory by mistake. Sorry I cannot remember who proposed this naming scheme.
Remember, if something can go wrong, it will.

pmas
To make errors is human. But to make million errors per second, you need a computer.

Replies are listed 'Best First'.
Re: Re2: Is it a good idea to store images in a RDBMS?
by MeowChow (Vicar) on Jul 21, 2001 at 20:51 UTC
    Consider, that if you store them in database, you will need to extract them into temporary files each time you neet to generate page containing them.

    Not necessarily. One could write a CGI / handler that fetches a picture directly from the database, which to a browser, would look no different than a request for a file. This sort of thing was recently discussed here.

       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
      ++ for you MeowChow! I did not know trick from your link!
      Now I recall: It is because every item is loaded from HTTP server to browser separately, by separate request, and only on client side rendered together to make a page. So you can create CGI script which will look like one .gif file for browser. I *read* about it, but knowledge was not digested. Now it is!

      So much more to learn!

      pmas

      To make errors is human. But to make million errors per second, you need a computer.