I figured I'd post a follow-up to the discussion earlier this week on issues
relating to storing images in MySQL.  

In my opinion.  

Whether you store images in MySQL ultimately depends on whether you can
setup a caching accelerator (like Squid) between you and your visitors.
Storing images in the database adds a minimum of around 28 ms of latency.
Cacheing makes this a mute point since images are once again stored as
files.  The main benefit is that you can more easily manage a large number
of images by storing them in the database.

Most people, those on shared hosting services, aren't going to likely have
access to a caching accelerator, so originally storing images as files is
probably going to be the best approach.  The most common approach that I've
seen is to create some sort of directory hiearchy and divide images in
groups of 1000.

Two other points came up while I was playing around with this.  

People on dial-up accessing test pages didn't notice any difference in
performance - their average ping times to the server were around 120ms.  I'm
guessing their connection latency helped to buffer the difference between
the two approaches.

Pulling images from the database usually involves a script with a parameter
that indicates which image to display.  For example, like this:

       <img src='http://www.myhost.com/display_image.php?id=5'>

Locally installed firewalls (Zone Alarm, McAfee Internet Security, and
Norton Internet Security) all blocked the display of images that were served
with a script like this.  Getting the images to display required renaming
the script, using Apache forcetype commands, and manually parsing the URL to
get the image id to display.  In other words, the url ended up like this:

        <img src='http://www.myhost.com/display_image/5'>

Anyone who sends me a request can get copies of the scripts and help on
trying to set something up to duplicate what I did.

Thanks to everyone who helped me with this - especially Dreamwerx.

-Ed




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to