Re: application scope store



stf wrote:
rf wrote:
If there are a lot of hits to the same data in a database then that data is already cached, for free. It's called the operating system file system cache and it does a far better job than anything you could ever do.

What if that database is on another computer, for instance? I guess in this case a local (to the PHP application server) cache could do better. :-)

Also you seem to be neglecting the cost of query parsing and execution? Though filesystem cache is about low-level IO only.

Do you know of any application scope stores for PHP? I mean something as simple as $_SESSION (not a database to query).

STF

The overhead for parsing a query is very low, especially the second and later times around. Execution is quite quick, also. The slowdown in databases is inefficient database design, often times requiring full table scans. Even if the database is on another computer, unless you have a slow (or very heavily loaded) network, returning a few K bytes of data is almost instantaneous.

No, there are no application scope stores in PHP, although you could build your own using the shared memory examples. However, at this point you are definitely prematurely optimizing.

Build your application. *IF* you have a problem (and you probably won't), find out where the problem is. Chances are it is not going to be in the cached queries.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages