Subject | Re: File/document managament on Firebird |
---|---|
Author | tigereye_philip |
Post date | 2004-10-05T04:43:13Z |
(Replying through groups.yahoo.com, this message didn't arrive in my
box, only its previous reply.)
I've done the "store links to files on the filesystem" thing before.
It works, but if you're updating documents often and care that the
filesystem and database stay synchronized, this means a lot of work
to try to make the two be "one" transactionally. I wind up having
code moving/copying files around, so I have a backup copy in case I
need to undo some previous action, based on whether the database
transaction commits/rolls back, which in turn means I have possible
failure points with low disk space preventing a copy to a temp file,
or temp files not getting deleted (if my code fails unexpectedly
otherwise). You also have a lack of security, as the database
security mechanism no longer protects your files (though there's a
security hole concerning blob id's being usable if you know them,
even if your user had no way of getting access to them in the first
place) ... and changes to documents obviously go through only the
filesystem's transactional safety, which is usually lacking, but then
you've got to let your applications write to disk eventually anyway
so you'll always have risks there. I strongly suggest you stick to
using blobs if you have that option; the performance isn't bad, the
safety's good, the security's okay, and it's much simpler to make
work consistently (and you've already done so once.) At the same
time, I'm also writing (side-project) a plugin-based file search/meta-
update program which doesn't touch the files themselves at all, so
who am I kidding? (But dead links don't bother me here -- it's just a
finder, and if links die, well, either it can try to find the files
again, or just remove their meta-info from the database. I don't have
much in the way of strict consistency requirements.)
-Philip
box, only its previous reply.)
I've done the "store links to files on the filesystem" thing before.
It works, but if you're updating documents often and care that the
filesystem and database stay synchronized, this means a lot of work
to try to make the two be "one" transactionally. I wind up having
code moving/copying files around, so I have a backup copy in case I
need to undo some previous action, based on whether the database
transaction commits/rolls back, which in turn means I have possible
failure points with low disk space preventing a copy to a temp file,
or temp files not getting deleted (if my code fails unexpectedly
otherwise). You also have a lack of security, as the database
security mechanism no longer protects your files (though there's a
security hole concerning blob id's being usable if you know them,
even if your user had no way of getting access to them in the first
place) ... and changes to documents obviously go through only the
filesystem's transactional safety, which is usually lacking, but then
you've got to let your applications write to disk eventually anyway
so you'll always have risks there. I strongly suggest you stick to
using blobs if you have that option; the performance isn't bad, the
safety's good, the security's okay, and it's much simpler to make
work consistently (and you've already done so once.) At the same
time, I'm also writing (side-project) a plugin-based file search/meta-
update program which doesn't touch the files themselves at all, so
who am I kidding? (But dead links don't bother me here -- it's just a
finder, and if links die, well, either it can try to find the files
again, or just remove their meta-info from the database. I don't have
much in the way of strict consistency requirements.)
-Philip
--- In firebird-support@yahoogroups.com, Raigo <raigo77@s...> wrote:
> I need to develop a file and document managament system. My
question:
> would it be a good idea to store all files in Firebird BLOB?
>
> I can see two possible ways:
> 1)all files are in BLOB
> 2)files are in (windos) filesystem and there is a link (filename)
stored
> in FB
>
> What would be better?
>
> I already have a system of over 100000 images in BLOB - no speed
> problems at all. But this one is going to be much bigger and mainly
will
> be storing Office (.doc, .xls. ppt), Acrobat (.pdf), AutoCAD (.dwg)
> files (probably will be used for even more formats).
>
> Has someone here developed some file/document management system on
> FB/IB? is it possible to see it? How does its data model look like?
>
> Any advice would be more than welcome.