David Nicol wrote:
My gripe with Storable is that it is not possible to access into the storable
object without thawing the whole thing.  An idea has just occurred to
me however,
which is, it may be possible to create some kind of tie wrapper that would appear to be thawing a Storable object, but all data would continue to reside in
the disk file instead of in memory, with new data getting tacked onto the end.
Locking of course would be among the fairly short list of tricky parts
to implement
this.  So here's the question:  does it already exist?  Has anyone written a
wrapper around the Storable on-disk persistence format that gives a
set of tied objects
that continue to refer to the file?  Sort of like those tools that
open a compressed
archive as a directory?

You sound like you're after Prevayler-style persistence - ie, "persist
everything, don't make me specify the data schema, and lazy load when you
get to the objects I explicitly asked to save".

This is the storage style that Pixie brought to Perl, and I shamelessly
stole for Tangram::IDBIF and friends.

If you are using Tangram, and you have a "storable" column or "idbif"
property set that maps to a particular column, then you may freely have
other Storage objects in the data structure which is stored.  ie, every
point in the data structure which you said "$storage->insert($foo)",
will be subject to this lazy loading/updating principle.

There are plenty of caveats to the approach, but feel free to ask any
questions you might have here, on the t2-users list[1], or in #tangram
on irc.perl.org.

And yes, this uses tie ;)

Sam.

1. http://tangram.utsl.gen.nz/lists/t2-users/

Reply via email to