[Zope] large images to a database via zope.

Philippe Jadin philippe.jadin@123piano.com
Fri, 13 Apr 2001 10:59:01 +0200


> The advice usually is to *not* store images in the database, which then
> voids the rest of your question. Store the images in the file system and
> store only a link to them (and any meta-data) in the DB. Searching the
> MySQL archives, you will certainly find repeated discussions of this.

More generally, the advice would be not to store large files of any kind in
a db.

This makes me thing about this :

It must be the same in zope : it must take more time to extract some data
from a large file in the filesystem (the data.fs) instead of storing a link
to it in the db, and store it on the filesystem. I guess the filesystem is
allways the fastest way to retrieve data (for example because it uses
caching, raid optimizations...)

What would be a really cool feature in zope is a new behavior of the zodb :
have the admin set a "maximum file size" to be stored in the db. If a file
uploaded to zope is larger, it would be stored automatically on the
filesystem. This decision could also be based on datatypes.

I personnaly do not trust this much a big binary file. For instance it's a
lot harder to make a backup of a large 100 Mb file than several smaller
files. You would only backup modified parts. Often the larger files are
never modified because they are big images / downloads.


Philippe Jadin (who hopes it's not a stupid idea)