[Tutor] File storage vs DB storage.
Christopher Arndt
chris.arndt at web.de
Wed Apr 11 16:21:26 CEST 2007
OkaMthembo schrieb:
> Indeed, using directories may be a better bet when there are many files
> involved. At least, this has been my feeling, and i gather the same from
> your replies.
I suggest that you take a look at a database abstraction layer or ORM like
SQLAlchemy [1], that makes handling the data layer much easier and also allows
you to map different data sources (e.g. file system/database) onto the same
data object very easily.
For example, there is a recipe in the SQLObject docs [2] on how to store images
in the filesystem but access them transparently via object properties (aka
dynamic attributes). This recipe could be easily applied to SQLAlchemy mapper
objects as well.
Chris
[1] http://sqlalchemy.org
[2] http://sqlobject.org/SQLObject.html#adding-magic-attributes-properties
More information about the Tutor
mailing list