Re: Storing images in PostgreSQL databases (again)

Поиск
Список
Период
Сортировка
От Guy Rouillier
Тема Re: Storing images in PostgreSQL databases (again)
Дата
Msg-id D4D1632DC736E74AB95FE78CD609007923B124@mtxexch01.add0.masergy.com
обсуждение исходный текст
Ответ на Storing images in PostgreSQL databases (again)  (TIJod <tijod@yahoo.fr>)
Ответы Re: Storing images in PostgreSQL databases (again)  (Steve Atkins <steve@blighty.com>)
Re: Storing images in PostgreSQL databases (again)  ("Merlin Moncure" <mmoncure@gmail.com>)
Re: Storing images in PostgreSQL databases (again)  ("DEV" <dev@umpa-us.com>)
Список pgsql-general
TIJod wrote:
> I need to store a large number of images in a
> PostgreSQL database. In my application, this
> represents a few hundreds of thousands of images. The
> size of each image is about 100-200 Ko. There is a
> large turnover in my database, i.e. each image stays
> about 1 week in the database, then it is deleted.

I see little value to storing the images in the database.  For me that's
a general statement (I'm sure others will disagree); but especially in
your case, where you have a high volume and only want to store them for
a couple days.  Why incur all the overhead of putting them in the DB?
You can't search on them or sort on them.  I would just store them in
the file system and put a reference in the DB.

> but this wouldrequire a more tricky implementation, and ACID-ity
> would be difficult to ensure -- after all, a database
> should abstract the internal storage of data, may it
> be images).

I can't get excited about this.  First, given the amount of overhead
you'll be avoiding, checking the return code from storing the image in
the file system seems relatively trivial.  Store the image first, and if
you get a failure code, don't store the rest of the data in the DB;
you've just implemented data consistency.  That assumes, of course, that
the image is the only meaningful data you have, which in most situations
is not the case.  Meaning you'd want to store the rest of the data
anyway with a messages saying "image not available."

--
Guy Rouillier

В списке pgsql-general по дате отправления:

Предыдущее
От: "Leonel Nunez"
Дата:
Сообщение: Re: Storing images in PostgreSQL databases (again)
Следующее
От: "Shoaib Mir"
Дата:
Сообщение: Re: Help required