Re: bytea and text

From: Kris Kewley <kris(dot)kewley(at)gmail(dot)com>
To: "rterry(at)pacific(dot)net(dot)au" <rterry(at)pacific(dot)net(dot)au>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: bytea and text
Date: 2009-11-29 13:41:58
Message-ID: 18A106A7-D0AD-4789-9BF3-66ABD1E6A003@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Some interesting points were made. Depending on the roadmap for you
application consideration should be given to storing the image files
outside of the db.

IMO the driving factors here are:
1. Scalability
2. Version control of images
3. Backup
4. Performance

Including images in your db will accerlate it's growth. You noted
legal concerns, version control is typically an important aspect of
this. Back up and restore time will increase as db size is larger, and
will be more costly (assume db on more expensive disk than file
server). Finally performance.. Blobs typically increase disk io on
queries (at least they do in oracle) so should be used judicially in
heavily accessed tables.

Realize that I have made some wild assumptions about your app here,
but this is my experience.

Consider a link in your db and using cvs for storing the images, or
filesystem depending on the extent of to your needs.

I too stand to be corrected :-)
Kris

On 29-Nov-09, at 3:30, richard terry <rterry(at)pacific(dot)net(dot)au> wrote:

> On Sunday 29 November 2009 17:50:10 Didier Gasser-Morlay wrote:
>> I hope you won't mind if I had my 2 cents to this conversation;
>> aside from
>> the actual format, this question comes up with regularity on various
>> database lists.
>>
>> I have never understood the need for storing images inside a
>> database (and
>> to some extend blob data) because:
>> - being a blog you do not query it just store and retrieve, you
>> rarely
>> update, so the need for a fancy SQL and DB engine is somewhat
>> limited;
>>
>> - storing images is heavy, makes the database grow, thus makes
>> backup/restore that bit more painful and possibly that bit less
>> stable. ..
>>
>> For years I designed system for picture libraries where numbers
>> like 10s of
>> thousands to millions of images are common place, we would never have
>> contemplated to store images on anything more complex than a file
>> system.
>> using the database to store a URL to that resource.
>>
>> Hope this helps
>>
>> Didier
>>
> this is **mission critical** for me (alone perhaps) as the images
> (usually
> very small (eg many could be 15K for a small photo, 3k - 16K for a
> small
> diagram of a body part) are part of some medical record software I'm
> writing
> for myself, and sit in the progress notes when displayed. Just
> alteration of
> a line drawn on a body part for an injured patient could end you up
> in court
> or de-registered.
>
> Medico-legal issues abound.
>
> Yes, one can easily backup files in a directory, but my current
> feeling is its
> easier to do an entire DB dump - could be wrong, stand to be
> corrected.
>
> Regards
>
> Richard
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jean-Yves F. Barbier 2009-11-29 14:30:57 Re: bytea and text
Previous Message Syan Tan 2009-11-29 11:29:51 Fwd: Re: bytea and text