use the adodb class:
http://php.weblogs.com/adodb together with mysql ..
it comes with a very good caching function ..
use plain textfiles created out of the database by a cronjob if you have a real heavy visited site .. the serialize/unserialize command might fit your needs to use the results in variables ..