I hate mention another language, but query caching is one area where Cold Fusion shines. (I'm a huge PHP fan and user, I'm just sharing my experience.)
I have worked on sites with high traffic, and been able to greatly reduce the page load times and database load by using "cached queries". Here's a quote from the administrator area of Cold Fusion: "Limits the maximum number of cached queries that the server will maintain. Cached queries allow for retrieval of result sets from memory rather than through a database transaction. Since the queries reside in memory, and query result set sizes differ, there must be some user imposed limit to the number of queries that are cached. When this value is exceeded, the oldest query is dropped from the cache and is replaced with the specified query" This is from the settings page where you specify the global server settings, kind of like php.ini. I think caching in memory is a faster and better way of caching, as writing to a file seems to have limits on speed and resources, and therefore can only be so much better than querying the database directly. One thing that strikes me as a reason this can be accomplished in Cold Fusion is that when you create a query, you assign it a name, datasource, etc. So each query has an "Alias", so the results can be stored in memory. There isn't really that type of alias on PHP, unless you could somehow set the return results to a global variable. So, what about caching database results in memory? Thanks, Peter Janett New Media One Web Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.0.6, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PostgreSQL coming soon! http://www.newmediaone.net [EMAIL PROTECTED] ----- Original Message ----- From: "Matt Friedman" <[EMAIL PROTECTED]> To: "'Manuel Lemos'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, January 21, 2002 9:16 PM Subject: RE: [PHP] How should I cache database data for php? > My experience has been that large sites that need lots of db and file > access and that are heavily trafficked use a file caching solution. > > Results of db queries and dynamic pages are loaded into flat files which > the client then browses. This is the type of system used by sites that > get in the millions of hits per month. It's simple and it works. > Generally the database is the bottle neck. Using a file cache system > avoids using the db. Pretty straightforward. > > The other strategy is to scale the hardware which is wise also. Sites > that get that many hits are generating $$$ so the cost of hardware is > cheap for them. They may have several gigs of memory per server and very > fast processors. These machines can handle very large peaks in activity. > > Matt Friedman > Web Applications Developer > www.SpryNewMedia.com > Email: [EMAIL PROTECTED] > > > -----Original Message----- > From: Manuel Lemos [mailto:[EMAIL PROTECTED]] > Sent: Monday January 21, 2002 10:07 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] How should I cache database data for php? > > Hello, > > Jeff Bearer wrote: > > I want the app to query the caching layer just about the same way it > > queries the database, but add a few other details, time to live, cache > > name etc. The caching layer will check to see if the query is cached, > > make sure it's not expired, and return the data just like a result set > > from the db query. If it is expired, or doesn't exist then it will > > query and create the cache file for next time. > > > > I'm leaning toward storing the data in XML, and kicking around the > idea > > of storing it on a ram disk so it would have killer fast access time. > > XML? Why? > > In my experience, using XML for things that need to scale is a major > mistake. If you want to serve HTML, why storing data in XML? You will > need to parse and transform it in HTML which only makes things much > worse than just storing data in nicely normalized database tables. > > Regards, > Manuel Lemos > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]