Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have code which uses File::Cache for both disk-based lookup tables ("Have I seen X before?") and storing metadata about an item. The API is fine, but filesystem performance with very large caches is just too slow (even after playing with the "cache_depth" param.), so I'd like to use a database to store this information instead. (I'm not too worried about speed, but it needs to be lightweight). However, I can't seem to find any module that does this. Am I looking in the wrong place, or should I just write my own? :-)

Replies are listed 'Best First'.
Re: Cache Modules Using DBI
by Corion (Patriarch) on Jan 27, 2006 at 14:26 UTC

    Look at what Cache::Memcached and memcached do. I don't think that caching via DBI will be much better than caching on disk, though. But if you have enough machines and/or enough RAM, memcached might be an interesting alternative to avoid hitting the file system.

Re: Cache Modules Using DBI
by perrin (Chancellor) on Jan 27, 2006 at 14:30 UTC
Re: Cache Modules Using DBI
by Anonymous Monk on Jan 27, 2006 at 14:31 UTC
    Try BerkeleyDB.
Re: Cache Modules Using DBI
by dragonchild (Archbishop) on Jan 27, 2006 at 16:41 UTC
    DBM::Deep is a favorite of mine. While it doesn't cache in the way you're looking for, it uses minimal file-system overhead. And, the nice thing is that it uses standard Perl datastructures.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?