List:General Discussion« Previous MessageNext Message »
From:Terrence W. Zellers Date:March 29 2000 3:40pm
Subject:Re: Opinion on Database versus Unix Directory for Image
View as plain text  

On Wed, 29 Mar 2000, Ed Carp wrote:

> James Treworgy (jamie@stripped) writes:
> > At 05:13 PM 3/25/00 -0600, Ed Carp wrote:
> > >Having said that, your biggest bang for the buck is going to be writing 
> > >your stuff in C as an Apache module (calling the MySQL C API directly) and 
> > >storing your images in the database.  A Perl script is going to be slower 
> > >executing than a native executable.
> > 
> > This may be a dumb question, but how do you then generate a web page that 
> > includes this image data stored in a database which is then served up to 
> > the client? That is, in the end your highest level code is going to be 
> > generating some HTML with <IMG SRC="..."> tags to create the page. If the
> > image data is coming from a database, rather than a file, then that SRC 
> > link must invoke another routine which queries the database, and passes 
> > back the image data, which will end up being handled by the web server 
> > anyway to pass it to the client. Exactly how would you implement this, and 
> > why would this be faster than simply including a file reference and letting 
> > your web server pull the data directly from a file?

    The IMG tag likely references a URL which is going to cause your 
browser to issue another request anyway; any given web page causes
anywhere from one to hundreds of separate requests to the http server and
usually each IMG is another request.  That URL can reference either a 
fixed file or a script.  Said script could indeed write the http headers,
retrieve the image data, writing it on the fly, then the http close.
Writing a flat file can be faster becuase the image can be cached, and
once retrieved by your browser (or by a caching server, or by any
caching proxy server) it can be loaded locally from the browser or 
wherever cached without actually reading from the file.   Reading the
image from the DB may or may not be faster than reading a file 
depending on the file system.
                                                 -- TWZ

| Copyright 2000 by Terrence W. Zellers.  All rights explicitly reserved. |
| email: terrence.w.zellers@stripped |
|   If this were really my signature, you couldn't read it anyway.        |

Re: Opinion on Database versus Unix Directory for ImageEd Carp29 Mar
  • Re: Opinion on Database versus Unix Directory for ImageTerrence W. Zellers29 Mar
  • Re: Opinion on Database versus Unix Directory for ImageTonči Grgin1 Apr
Re: Opinion on Database versus Unix Directory for ImageTonči Grgin1 Apr