RE: [PHP-DB] using php and mysql with images
| From: | Ian Willis | Date: | Thu, 29 Jun 2000 03:31:44 +0000 |
| Subject: | RE: [PHP-DB] using php and mysql with images | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-725@lists.php.net to get a copy of this message | ||
Yes the performance may suffer but storing all the information in a database
make sense for a number of applications where
The data is structured and the image is part of the structure, performance
gains may be better realized by hardware and other optimisations.
The quantity of data is such that the organisational benefits of the
database more than outweighs the performance hit.
Basically storing images external to the database is a performance kludge,
it is inelegant but useful in a number of situations. Once this fact is
accepted the whole response of images is database is bad can be seen as a
load of twaddle. An example is that I work for a research organisation that
studies insects in Australia, there are around 200000 species of insects in
australia. Each species may have have multiple blob associated with it such
as DNA sequences, images etc. Should I have in excess of 200000 image files
in a directory?
A useful answer would be to point to some figures that allow the user to
glean when storing images in a database would be appropriate, when it is a
borderline case and when it is silly. Currently I don't know these things
but I would appreciate some rough benchmarks came out that allowed users to
find an appropriate compromise between performance and data integrity.
--
Ian Willis
Unix Systems Administrator
Division of Entomology
CSIRO
ph 02 62464391
> -----Original Message-----
> From: php3@developersdesk.com [mailto:php3@developersdesk.com]
> Sent: Thursday, 29 June 2000 10:57
> To: Cosenza, Mario; php-db@lists.php.net
> Subject: RE: [PHP-DB] using php and mysql with images
>
>
> Addressed to: "Cosenza, Mario" <mcosenza@engsvcs.com>
> php-db@lists.php.net
>
> ** Reply to note from "Cosenza, Mario" <mcosenza@engsvcs.com>
> Wed, 28 Jun 2000 12:35:38 -0400
> >
> >
> >
> > Check out
> > http://www.phpbuilder.com/columns/florian19991014.php3.
> > This is how I learned it.
> >
> > I still don't know the performance implications of doing this. Does
> > anybody know how well MySQL handles blobs (expically lots of them?)
> >
>
> This has come up many times, and I think the consensus on the list is
> that there is little to no advantage to storing your images in the
> database. Store the images in a directory, and put the filename in the
> database.
>
> Since images are retreived by <IMG SRC="filename"> you have to provide
> a separate program to get the image out of the database and send it.
> There is no way to inline the images with the web page source when you
> send it, it is always a separate transaction.
>
> To get an image from the database you have to run a program,
> open a database connection, transfer the image from db to program,
> add the headers, and send it. It is easier and faster to let the web
> server send the image file.
>
>
> > Mario
> >
> >
> > -----Original Message----- From: Matt Dooner
> > [mailto:mdooner@mindspring.com] Sent: Wednesday, June 28, 2000 12:35
> > PM To: php-db@lists.php.net Subject: [PHP-DB] using php and mysql
> > with images
> >
> >
> > Here's what I need to do; Take an image from a file input in an HTML
> > form and, using php, put it into a mysql blob feild. Later,
> I need to
> > take the blob and display it as an image on a web page. Is this
> > possible and if it is, could someone please tell me how to
> do this. I
> > have search though both the php and mysql docs and have found
> > nothing.
> >
>
>
> Rick Widmer
> Internet Marketing Specialists
> www.developersdesk.com
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
>