Re: [PHP] Re: how to display images stored in DB
- From: robert@xxxxxxxxxxxxx (Robert Cummings)
- Date: Wed, 28 Feb 2007 19:41:19 -0500
On Wed, 2007-02-28 at 17:04 -0500, Mark wrote:
Kevin Waterson wrote:
This one time, at band camp, zerof <zerof@xxxxxxxxxxxx> wrote:
It is not a good practice to store pictures in DataBases, use links,
instead of.
Rubbish, where are your benchmarks?
It has almost nothing to do with benchmarks.
Images are typically best supported in the form of files. They are more
easily manipulated by external tools.
The web browser sees an image as a single HTTP request. Invoking the PHP
script engine, parsing the script, and executing a SQL query to retrieve
the image from the database is less efficient than letting the web server
just send the file.
Image files do not need to be constrained by the rigid requirements of a
relational database.
I could go on, but it should be clear enough that putting images in a
database is not a good idea.
What about when you need to share those files across a 50 node network?
I'd keep it in a database, then when I need it cache a local copy on the
filesystem. Then I can just check the timestamp in the database to see
if the file has changed. Voila, multi-node high availability images.
Seems better than have a local copy of every single image. I guess the
answer is... it depends on what you're doing!
Cheers,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
.
- Follow-Ups:
- Re: [PHP] Re: how to display images stored in DB
- From: "Richard Lynch"
- Re: [PHP] Re: how to display images stored in DB
- From: markw
- Re: [PHP] Re: how to display images stored in DB
- Prev by Date: Problem with pgsql.so and extensions.
- Next by Date: Re: [PHP] how to retrieve pictures from postgreSQL DB
- Previous by thread: Problem with pgsql.so and extensions.
- Next by thread: Re: [PHP] Re: how to display images stored in DB
- Index(es):