Categories


Loading feed
Loading feed
Loading feed

Oracle + PHP = Cool solution for Clearing an Invalid Cache


I don’t know about you but Oracle Developer’s Network is not the first web site on my list every morning for high-quality PHP articles. (DevZone is, in case you are wondering.) I’ll have to say though, my opinion is changing. Their article Improve PHP Performance by Caching Database Results is a great reference for anyone using PHP and Oracle. The concepts they cover are generic across many database platforms. Their code, as one would expect, is germane to using Oracle with PHP.

Their code builds a change notification and database caching system. It solves the age-old problem of outdated cache data. Specifically when your web server and your database server are on separate hardware. Their solution, while not for the faint of heart, is an elegant one and Yuli Vasiliev, the author, does an excellent job of walking you through both the concepts and the code. In his own words:

While caching database result sets is generally a good idea when the database you are using does not reside on the same machine as the Web server, determining the best caching strategy for your situation may be a challenge. For example, a time triggered caching approach, which is commonly used in caching systems and assumes that the cache is regenerated each time an expiry timestamp is reached, may not be a satisfactory solution for the application where using up-to-date database result sets is crucial. In this case, you need to employ a mechanism that will notify your application each time a change occurs to the database data the application is interested in caching, so that the application can reconcile cached, out-of-date data with the database.

They even manage to throw in a slice of PEAR by using PEAR::Cache_Lite as the actual caching mechanism.

If you use Oracle with PHP this is an excellent article. If you are interested in data caching and techniques for expiring caches, this is an excellent article. As a matter of fact, this is just an excellent article!

=C=

Comments


Monday, June 19, 2006
FAINT OF HEART?
7:29PM PDT · Anonymous User [unregistered]
FAINT OF HEART
11:37PM PDT · Cal Evans (editor)