trochee: (Default)
trochee ([personal profile] trochee) wrote2009-03-10 03:33 pm

a question for Perl-wonks

For the techies in my readers list:

I am looking at mechanisms for persistence of a fairly large, but potentially-expirable, data pool -- for simplicity, suppose it's recent livejournal entries. (no, I'm not writing a livejournal client! just an example).

I am building tools that want to know about recent activity, but might also sometimes want to look at the recent history; yet I'd only like to invoke the tool from a cron-job or something similar.

I've just discovered Apache::Session -- and though that's designed for web use, it seems like it might be a good choice anyway. But there's also Cache, Cache::Cache, and CHI -- any experience on whether one or another of these is the thing to go with? Looks like the last of these is the most recently updated, which is either a sign that it's the best material or that it's the latest reinvention of the wheel.

So: any recommendations on a data-cacheing class for a repeated invocation of the same process, such that it can "remember" what's been done before?

[identity profile] xaosenkosmos.livejournal.com 2009-03-10 11:04 pm (UTC)(link)
What's wrong with using good old tie on DBM or DB_File? Manual expiry is a pain?

(I really like SQLite, but perl's got much better support for much crappier databases built right in =\)

[identity profile] trochee.livejournal.com 2009-03-10 11:10 pm (UTC)(link)
nothing's wrong with a direct use of tie; I just realized that expiry is complicated, and file locking, and i'd want to be able to switch out the back-end, and and and.

then i thought "I'm not the first person to think about this, am i?" and I started poking around at CPAN, which is where I found this embarrassment of riches.

But perhaps I should just implement it with a DB_File for now and switch out later.

[identity profile] trochee.livejournal.com 2009-03-10 11:27 pm (UTC)(link)
also, i'd like to store non-flat structures. so perhaps I'll use MLDBM instead, or just use Storable.

[identity profile] boobirdsfly.livejournal.com 2009-03-11 07:49 am (UTC)(link)
I'll give you repeated invocation.

:P