[Zope] should files be stored in RDBs?

Thomas B. Passin tpassin@mitretek.org
Mon, 20 May 2002 15:07:16 -0400


[Charlie Fulton]

> I'm setting up a database to store data file for a scientific research
> group.  I'm thinking of writing the data into a MySQL table rather than
> storing them externally in the filesystem.  The files are generally small
> but the number of them will grow quickly.
>
> Are there opinions as to whether this is a good or bad idea?
>
> I know there's overhead and a (severe?) throughput penalty, but I was
> thinking this would be simple to manage (and back up) as well as being
easy
> to search.  The load on the server won't be much anyway.
>
> Can collecting binary data in a web form and writing it to MySQL be done
> totally in DTML?  I've found some past threads in the list dealing with
this
> kind of thing (and an old how-to) but there doesn't seem to be a consensus
> on a "right" way to implement it.
>

It's certainly feasible to insert data into a relational database using
DTML.  If the data is truly binary, it's probably not very well suited for
web forms, where some characters are not allowed without escaping.

It also would depend on what you want to do with the data, and whether there
is any metadata that needs to be attached to the data.  For example, it's
one thing to store a blob in a table, and another to find the right data
later on.  Of course, you have the same problem when you store files.  You
may find that it's better to store the files in the file system and the
metadata in a database, either the ZODB or in a relational database.

Cheers,

Tom P