Re: Images in Database

From: "Rod K" <rod(at)23net(dot)net>
To: "M(dot) Bastin" <marcbastin(at)mindspring(dot)com>, "Reshat Sabiq" <sabiq(at)purdue(dot)edu>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Images in Database
Date: 2004-03-27 19:58:57
Message-ID: KNEPILBLIADCDMMPIKIKCEMCFDAA.rod@23net.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I couldn't agree more. I used to subscribe to the notion that there wasn't
a benefit to storing images in the DB. After some heartache, I've had to
eat my words.

We have a solution where we receive hourly updates from an external source.
The updates include CSV files that are parsed into the DB and tar'd jpgs.
The original procedure called for the images to be stored in the filesystem,
and that worked fine for awhile. Unfortunately, it didn't scale very well.
Now, we have multiple clients using the same data/images on their websites.
For now, all sites are served off the same server so a symbolic link to the
directory where the images exist for each site would work, but we'll most
probably not have all the sites on one web server as we grow. Now, we're
talking about over 4GB of images and growing. Maintaining multiple copies
would be a nightmare. Moving the images to the RDBMS was the only scalable
solution.

Furthermore, having the images in the DB means they get backed up with the
DB. Since the web site pages/scripts/etc are very static, we can do with
less frequent backups of that system now that the images are gone from
there.

> -----Original Message-----
> From: pgsql-novice-owner(at)postgresql(dot)org
> [mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of M. Bastin
> Sent: Saturday, March 27, 2004 2:12 PM
> To: Reshat Sabiq
> Cc: pgsql-novice(at)postgresql(dot)org
> Subject: Re: [NOVICE] Images in Database
>
>
> At 12:34 PM -0600 3/27/04, Reshat Sabiq wrote:
> >I think unless the DB provides some image-searching capabilities,
> >it's better to store them as paths to save the space. A lot of
> >storage will be wasted otherwise. Isn't that so?
>
> PostgreSQL has no limit on storage except for the hard disk's limit.
> You shouldn't worry about that.
>
> The trouble with paths is that you must be able to resolve them from
> any client that connects to your database. It's also harder to move
> the entire database afterwards if you must, or to otherwise
> reorganize your directories.
>
> Having everything in your database is much much cleaner and will save
> you a lot of headache when you modify your solution in a next
> programming round.
>
> Cheers,
>
> Marc
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mihai Tanasescu 2004-03-27 20:37:10 Philosophical question
Previous Message M. Bastin 2004-03-27 19:11:31 Re: Images in Database