Subject | Re: Using BLOB hurt performance significantly? |
---|---|
Author | Kevin Herrmann |
Post date | 2003-10-03T20:55:58Z |
Folks, I (thought) I posted a viable solution to this problem months ago, but
perhaps I miskeyed. This is crude and could be refined, but here's what I've
come up with:
a 'filewrite' stored procedure takes a file as blob parameter and returns a
unique ID. Inside this stored proc, generate a unique ID, store in a table and
store the blob on the file system named with the ID.
a 'fileread' stored procedure takes an ID and returns the BLOB by reading it
from filesystem.
If this is possible, and I don't know why it wouldn't be using UDFs, some of
the nice features are:
* the file is not on a share for everybody to dink around with
* read/write uses the DB protocol to handle, so if DB protocol passes, it
passes
* It doesn't consume any space in the database
This could be extended to allow for pretty filenames, listing functions, etc,
but you get the gist. BTW, if any implements this, please provide the code, as
I'd love to have this!
Thanks,
Kevin
perhaps I miskeyed. This is crude and could be refined, but here's what I've
come up with:
a 'filewrite' stored procedure takes a file as blob parameter and returns a
unique ID. Inside this stored proc, generate a unique ID, store in a table and
store the blob on the file system named with the ID.
a 'fileread' stored procedure takes an ID and returns the BLOB by reading it
from filesystem.
If this is possible, and I don't know why it wouldn't be using UDFs, some of
the nice features are:
* the file is not on a share for everybody to dink around with
* read/write uses the DB protocol to handle, so if DB protocol passes, it
passes
* It doesn't consume any space in the database
This could be extended to allow for pretty filenames, listing functions, etc,
but you get the gist. BTW, if any implements this, please provide the code, as
I'd love to have this!
Thanks,
Kevin
>
> ________________________________________________________________________
> ________________________________________________________________________
>
> Message: 2
> Date: Fri, 03 Oct 2003 08:51:04 -0000
> From: "Michael Fung" <ibo@...>
> Subject: Re: Using BLOB hurt performance significantly?
>
> Dear Almond,
>
> If what you said is true, I will go for the inline approach.
>
> Points 4 and 5 is the trouble that I really want avoid, because my
> users are remote so I need to build a protocol for them to
> upload/download blob data within the delphi application.
>
> Rgds,
> Michael
>
>
> --- In firebird-support@yahoogroups.com, Almond <almond@p...> wrote:
> > The simple answer is no. I found it have difference on network
> connection
> > only. I'm using php, I found that using persistent and non-
> persistent
> > connection has great impact on using blob (my bold size is about
> 20k each).
> >
> > The option to save the image path name depends on your application.
> I once
> > using this method. I encountered the following problem:
> > 1. One directory save many files is slow (???,???), you might
> choose
> > JFS/XFS if you are using linux.
> > 2. You might need to give read/write permission to your user on the
> server.
> > 3. Backup two set of data, 1 for firbird, 1 for image.
> > 4. You need to deal with two protocol, one is firebird, one is the
> file system.
> > 5. Further processing might have difficulties. Say, you save the
> path name
> > in linux and you want to use Crystal Report. So, you need to have
> samba on
> > linux and map to the correct drive to made this work.
> > 6. You cannot split the application server (e.g. apache with php)
> and the
> > DB server, or, you need some tricks to allow the application
> server upload
> > images to the data server.
> >
> > Is the above correct or I'm do something wrong ? Anybody please
> give comment.
> >
> > At 02:51 03/10/03 +0000, you wrote:
> > >Dear all,
> > >
> > >I need to attach some tiff images to data records. Each record will
> > >have 2 tiff of around 200KB. If I save the tiff data in a blob
> field,
> > >it will increase the current database size of 200MB to ~6GB. Will
> it
> > >hurt database performance significantly? Suppose I am using FB1.5
> on
> > >RedHat 9.
> > >
> > >TIA,
> > >Michael