Re: [binarycloud-dev] Re: ONE database abstraction layer
| From: | Manuel Lemos | Date: | Thu, 29 Nov 2001 02:12:13 +0000 |
| Subject: | Re: [binarycloud-dev] Re: ONE database abstraction layer | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-3174@lists.php.net to get a copy of this message | ||
Hello,
Peter Bowyer wrote:
> I agree. Having been trying to do a project using the PEAR DBA layer, I've
> come to the conclusion that it's incomplete. One thing which seems cool
> and I don't think Metabase has (?) is the ability to cache database results
Metabase does not have any query caching support deliberately. I do not
want to bloat Metabase with something that is not necessary to be part
of Metabase core. Also, practice demonstrated that is rarely more
efficient to cache single queries. It is better to cache the contents
that are generated with the query results, especially if you are
generating the contents from many queries.
This was evidently verified with work on the PHP Classes repository
where I verified that it is worthy to cache whole pages that depend on
queries that do not change their results all the time. The conclusion is
that application aware caches are more efficient than single query
caches.
You may find here the cache class that I developed. It is robust enough
to be used in busy sites like the PHP Classes repository site because it
uses file locks properly to prevent concurrent access to overrun the
cached contents that is stored in files. FYI, currently there are 600
files caching about 3.6MB of contents mostly not personalized. I could
use it to cache individual queries with Metabase by serializing an array
of query results, but as I said it is not worthy it.
http://phpclasses.upperdesign.com/browse.html/package/313
Regards,
Manuel Lemos