On Mon, Jun 23, 2003 at 08:09:57AM -0700, Hardik Doshi wrote: > > Hi Group,
Hi Hardik. > I have a question regarding retrieving the > information. I have the functionlity in which on every > user click, system needs to retrieve information for > particular user and display the page according to the > retrieved information. Now question is which is the > scalable solution? (1) Retrieve information from the > database on each user click. (2) Retrieve information > from the session (here information is retrieved once > and stored in the session file on the server, when > user logs into the system) I'd go for (2). Try to avoid constant database lookups if you don't really need them. The database server takes alot more resources to find a piece of data than mod_php4 takes to pull it out of a session file. Even data stored in cookies can be moved to session variables for use by the session. If page views then do not require database cycles *or* repeated cookie-based network traffic, you save both CPU and bandwidth. And the session data goes away when the session is destroyed. Anything you can do to save CPU and bandwidth is good. Unless you own shares in Intel and Cisco, of course. -- Paul Chvostek <[EMAIL PROTECTED]> it.canada http://www.it.ca/ Free PHP web hosting! http://www.it.ca/web/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php