Re: Images in Database - Mailing list pgsql-novice

From Reshat Sabiq
Subject Re: Images in Database
Date
Msg-id 4068F1ED.2070201@purdue.edu
Whole thread Raw
In response to Re: Images in Database  (Oliver Fromme <olli@lurza.secnetix.de>)
Responses Re: Images in Database
List pgsql-novice

Oliver Fromme wrote:

>Reshat Sabiq wrote:
> > [...]
> > Then the only reasons i can see to not store images in a DB, and the
> > following:
> > i. If the same images also need to be accessed from a file system, such
> > as by a web server, as regular URLs.
> > [...]
> > Of these 3, only i. appears to be a realistic concern for images. It's a
> > lot easier to list a URL on an [X][HT]ML page.
>
>That's not really a problem.  You can write a trivial CGI
>program in your favourite language (Python, PHP, Perl or
>whatever, even /bin/sh) that fetches an image from the DB,
>so you can write URLs like http://.../imgfetch.cgi?foo.jpg.
>
>You're even a lot more flexible that way, because you can
>fetch images by various criteria, not just by filename.
>
>Best regards
>   Oliver
>
>PS:  I've trimmed the "Cc:" list a bit.
>
>
>
Thanks. Good point. However, this would has a performance penalty. I'd
prefer not to use this approach for images accessed frequently,
especially if they are large, and even more so if the DB is not on the
same box as the web server.
But in general, you guys are right, most of the time storing images in
the DB is better. IMHO, there are however exceptions to that approach,
where referring to the file system is better.

--
Sincerely,
Reshat.
---
My email address has changed to sabiq@csociety.org. Current one, sabiq@purdue.edu, will be discontinued sometime after
April5, 2004. 
---
If you see my certificate with this message, you should be able to send me encrypted e-mail.
Please consult your e-mail client for details if you would like to do that.


Attachment

pgsql-novice by date:

Previous
From: joseph speigle
Date:
Subject: Re: dynamic interval in plpgsql
Next
From: Noel Faux
Date:
Subject: database replication Master - slave model