Subject Re: [firebird-support] Store large amount of Binary Data in FB
Author Martijn Tonies
> yogiyang007 a écrit :
> > Hello everyone,
> >
> > I am trying to create a software in which all the documentations that
> > are generated in our organization should be stored.
> >
> > For this I have created a BLOB type field also.
> >
> > Now my problem is that the data that I want to store in this BLOB
> > field consists of a variety of files which are .DOC, .TIF, .JPG, .RTF,
> > .TGA, .PDF, .XLS, .PNG, .DWG, .DXF. The average file size is around 23
> > MB and there are currently 300 files.
> >
> > How can I store these files in the BLOB field?
> >
> > Is it advisable to store such huge binary data in FireBird?
> not really

Really? Why not?

This is a very old discussion and it comes up now and again in all
lists concerning database systems.

> a more academic way is to store a path to the file in the database, and
> store the file itself in specific place (a dedicated disk for example)
> the access to the file could be: windows file sharing, or FTP, or HTTP,
> or something else

There is no "right way" of doing this. Some people store paths, some store
the entire document. It depends on your requirements!

Back to the original question:
> > How can I store these files in the BLOB field?

Depending on how you want to normalize things, you could do with
a simple "files" table or with several tables that make sense to your
organization, eg: employee_cvs for example.

Next, I suggest you store something like a file extension (and the original
filename) and so on in order to be able to know what kind of document
is in the blob, as Firebird itself couldn't care less what's in it.

If you don't need referential integrity, it's often useful to store the
files in a separate database in order to speed up backup/restore
process of the main database, if something happens. With two-phase
commit, you can control transactions for both databases at the same
time.


Have fun :-)


Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com