eXile has asked for the wisdom of the Perl Monks concerning the following question:
The application characteristics are such that writes are few, and most will be limited to a few tables. Reads will be more frequent so caching the results on the webserver might make sense (to me at least). So I was thinking of using something like Cache::Cache (which I can recommend), where I can map every table in the database to a 'namespace', use primary keys from the database as keys for the cache lookups, or use Class::DBI::Cacheable.
My main concern here is the algorithm for cache-replacement/update (or however you call it). Since my tables won't be updated a lot, periodically querying the database if a table is updated, and if so cleaning all cached info for this table seems a logical choice for me. I've been googling and cpan-ing a bit and haven't found any prior work on this, so either my idea is stupid or I've not searched hard enough.
I've been looking into the best way to do this in MySQL 3.23, I've seen 4.1 has some kind of table checksumming that could be used to see if a table is changed, and 5 versions have a statistics schema that could be used, but I can't find anything for MySQL 3.23. The best things I could think of are:
Anybody know of any modules that implement something like this, or other suggestions on how to do caching in this type of situation? (I can't change apache config, mysql version or web server hardware btw., at least not in the near future)
|
|---|