Log in

No account? Create an account
entries friends calendar profile Previous Previous Next Next
Language Computeer
Fists of irony
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?
4 comments or Leave a comment
xaosenkosmos From: xaosenkosmos Date: March 10th, 2009 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 =\)
trochee From: trochee Date: March 10th, 2009 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.
trochee From: trochee Date: March 10th, 2009 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.
boobirdsfly From: boobirdsfly Date: March 11th, 2009 07:49 am (UTC) (Link)
I'll give you repeated invocation.

4 comments or Leave a comment