DBM::Deep rocks

merlyn on 2004-05-19T15:29:03

I just finished writing an article for SysAdmin about lightweight persistent data solutions, and stumbled across DBM::Deep. Today, I'm combining that with Template, as in:

use Template; use DBM::Deep;
my $t = Template->new; # create engine
my $db = DBM::Deep->new("foo.db"); # create storage
$t->process($my_template, { db => $db });
We now have the db hash in the template which is effectively a permanent multi-level data structure. What's more, it can be safely shared between multiple processes (there are lock/unlock methods for critical regions).

This rocks. This module should be core. Down with MLDBM. Up with DBM::Deep!


Well...

zatoichi on 2004-05-19T16:29:33

I don't seem to be able to read it off your site. Do I have to wait for the mag?

Re:Well...

merlyn on 2004-05-19T16:52:49

Maybe you missed this:
[Content embargoed until 00:00:00 01-Aug-2004 per publisher's agreement.]
It means exactly that. After that date, you'll be able to read it on my site. Before that, yes, you'll have to get the original publication somewhere. Sorry, that's the rules.

Re:Well...

zatoichi on 2004-05-19T19:50:13

That is cool. I usually get that mag anyway. :-)

Baby, where have you been all my life?

samtregar on 2004-05-19T17:04:55

This module does look great. Fantastic docs, plenty of tests and zero interface bloat! Thanks for the pointer.

-sam

neat, but...

perrin on 2004-05-19T17:48:24

It seems mostly pointless to me. Performance won't be able to match that of C-based dbm systems + Storable. It may be a good option for people who have a VERY narrow and VERY deep data structure they want to store, but that isn't very common. It still has the same problems with TIE that MLDBM does, i.e. second-level data updates do not trigger the TIE methods.

Re:neat, but...

perrin on 2004-05-19T17:51:31

I take back the part about second-level updates: it handles these by TIE-ing the inner data as well. I guess this means it only works for standard Perl structures though, and can't store objects.