pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Karl Denninger <karl@denninger.net>
To: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Dennis Sacks <dennis@illusions.com>
Cc: Sam Adams <samadams@myfastmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: BLOBs vs BYTEA
Date: Tue, 1 Feb 2005 09:01:15 -0600
Message-ID: <20050201090115.A31386@denninger.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0502011002430.32497-100000@matrix.gatewaynet.com>
References: <41FEFCAA.5070603@illusions.com>
<Pine.LNX.4.44.0502011002430.32497-100000@matrix.gatewaynet.com>
On Tue, Feb 01, 2005 at 10:04:45AM +0200, Achilleus Mantzios wrote:
> O Dennis Sacks Ýãñáøå óôéò Jan 31, 2005 :
>
> > Sam Adams wrote:
> >
> > >Anyway, I was wondering which would be a better way to store a large
> > >amount of files each a few megabytes in size. There could be hundreds of
> > >thousands of files altogether. If stored as BYTEAs this would put them
> > >all in a single table. Would this effect performance considerablely? I
> > >assume if there were thousands then it would. But if the data is stored
> > >as BLOBs then aren't they store inside the database just in another
> > >table? Wouldn't this also be undesirable. Would it be better to store
> > >them normally on the file system and just provide the path and file name
> > >in the database. Obviously this wont provide any security or backup but
> > >would it make sense to do it this way with such a large amount of data?
> > >
> > >
> > This is one of those age old debates. I've done both, and I'll tell you
> > that in my experience it is less of a headache to store the files in the
> > filesystem (which is what filesystems are designed for) and store the
> > metadata in the database.
>
> I think if you are doing replication or write in java,
> you'll be much happier with bytea.
I store objects that are referred to in the database in the database.
This requires some more work for binary objects in the application code,
but not much.
And, it insures that integrity is maintained. Otherwise you need a
"cleanup" routine to cover the possibility of a file missing metadata, or
metadata missing a file, along with all the replication/backup issues.
No thanks on those for me.
--
--
Karl Denninger (karl@denninger.net) Internet Consultant & Kids Rights Activist
http://www.denninger.net My home on the net - links to everything I do!
http://scubaforum.org Your UNCENSORED place to talk about DIVING!
http://www.spamcuda.net SPAM FREE mailboxes - FREE FOR A LIMITED TIME!
http://genesis3.blogspot.com Musings Of A Sentient Mind
view thread (4+ messages)
Message-ID: <20050201090115.A31386@denninger.net> Permalink: ../20050201090115.A31386@denninger.net/ Also on: postgresql.org/message-id/20050201090115.A31386@denninger.net ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients using the --to and --cc options: reply via email To: pgsql-sql@postgresql.org Cc: karl@denninger.net, achill@matrix.gatewaynet.com, dennis@illusions.com, samadams@myfastmail.com Subject: Re: BLOBs vs BYTEA In-Reply-To: <20050201090115.A31386@denninger.net> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox