Re: Images in Database

From: Reshat Sabiq <sabiq(at)purdue(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Images in Database
Date: 2004-03-30 04:05:01
Message-ID: 4068F1ED.2070201@purdue.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)csociety(dot)org(dot) Current one, sabiq(at)purdue(dot)edu, will be discontinued sometime after April 5, 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.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Noel Faux 2004-03-30 06:45:23 database replication Master - slave model
Previous Message joseph speigle 2004-03-30 03:57:19 Re: dynamic interval in plpgsql