Object Persistence Using a File System

Bruno Desthuilliers onurb at xiludom.gro
Wed Jul 12 04:15:54 EDT 2006


Chris Spencer wrote:
> Before I get too carried away with something that's probably
> unnecessary, please allow me to throw around some ideas. I've been
> looking for a method of transparent, scalable, and human-readable object
> persistence, and I've tried the standard lib's Shelve, Zope's ZODB,
> Divmod's Axiom, and others. However, while they're all useful, none
> satisfies all my criteria. So I started writing some toy code of my own:
> http://paste.plone.org/5227
> 
> All my code currently does is transparently keep track of object changes
> without requiring any special coding on part of the user, and a function
> to convert an object to a file system hierarchy of folders and files.
> Please, let me know what you think.

As you say, using filesystem for fine-grained persistance may not be the
most efficient solution. I also wonder how (if...) you intend to address
concurrent R/W access and transactions...

A few observations and questions :
- you should avoid tests on concrete types as much as possible - at
least use isinstance
- tuples are immutable containers. What about them ?
- what about multiple references to a same object ?

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list