Maxim Maletsky
Founder, Chief Developer
ma...@phpbeginner.com
PHPBeginner.com (Where PHP Begins)
www.phpbeginner.com <http://www.phpbeginner.com/>
-----Original Message-----
From: Fifield, Mike [mailto:Mike.F...@schwab.com]
Sent: Tuesday, April 16, 2002 9:48 PM
To: php-g...@lists.php.net
Cc: 'Maxim Maletsky'
Subject: Storing images in MySql
After posting my question about performance earlier this morning it was
suggested that I also store the jpg's in the database, (thanks Maxim). I
did a little research and got a lot of conflicting information on
weather this is a good idea or not. For example the following url states
that you suffer a 30% performance hit by doing it this way.
http://www.zend.com/zend/trick/tricks-sept-2001.php
Is anyone out there running a website that stores images as binary data
in MySql that could comment on this?
Any and all comments are welcome.
Mike
"When using a normal Web server setup, images should be stored as files.
That is, store only a file reference in the database. The main reason for
this is that a normal Web server is much better at caching files than
database contents. So it it's much easier to get a fast system if you are
using files."
I guess Mysql developers are a good reference ;-)
--
Julio Nobrega.
Tô chegando:
http://www.inerciasensorial.com.br
"Mike Fifield" <Mike.F...@schwab.com> wrote in message
news:FFE9B7BE532CD411872F...@n6010vmx.nt.schwab.com...
*Storing* images in the database is only half the battle - you need to
have another script to pull them out and display them.
The only situation where this makes sense is if you want/need to
programmatically control access to images. Just like you can control
access to various other bits of data in the database, you can also
control access to specific image data in a database - but it's an extra
step to pull it out. An extra HTTP request, I should say.
If you don't have a need to programmatically control access to image
files, don't bother putting them in a database. Let the filesystem do
what it's meant to do - serve files.
Michael Kimsal
http://www.phphelpdesk.com
Guaranteed PHP support when you need it
734-480-9961