tags:

views:

544

answers:

4

I know you will say there are several duplicates for this question. I've read most of them. But I need an answer to the specific case I'm presenting.

I'm planning to store millions of small jpg images (about 3kb) in a Firebird database.

Assumptions:
- The table that will contain these images will not contain any other information but its key;
- It is not a web application;
- The images will never be updated;
- In most of the cases, the database will never grow to more than one digit GB;
- The server must be easy to be maintained, as there will be no DBA to take care of it.

Is it a good approach? Or should I consider save the images in the file system?

Please. I need an answer specific for non-web applications and for Firebird databases.

+1  A: 

At a previous company we stored 155 million images at 32kb each in an Oracle 8 (then 9 and then later 10) database. This also had more information held about each image.

So I would think FireBird should be able to hold a million or so with out breaking too much sweat.

graham.reeds
binary handling varies greatly from database to database, though. Oracle, for example, is very bad at storing BLOBs (it wrecks the tx log), but ok with RAWs. Firebird may suck at binaries also.
skaffman
It worked perfectly for us.
graham.reeds
A: 

I would recommend storing in a filesystem - BUT, do one or more of the three things:

  • Store them in a hierarchical directory structure (can't suggest details without knowing the context), so that there is no issue with reading large directories
  • Store them in sets within archives (e.g. tar), possibly compressed - to save on file system wastage from storing small files
  • Have a caching mechanism in your app.
DVK
A: 

The best approach is not to store the images in the dbase, but instead store them with the file system.

You can then use a image lookup table within your dbase, within which each record contains a relative or absolute path to the image files within the file system.

As a general rule it is very non-performant to hold to store images as blobs within a dbase.

madman1969
+1  A: 

I see one discussion about this in Firebird News

The question is : to blob or not to blob ?

Hugues Van Landeghem