HI:
I have a question about the relative performance of building a large $_SESSION array vs querying a MySQL database when you need info. I am sure there is no simple answer... just looking for some initial thoughts.
The application is built in PHP / MySQL. There are a number of pages which use the same information. So, there are a lot of scripts like "get_business_info.php", "get_customer_info.php", etc. which retrieve data from MySQL tables and are "included" on various pages. Some page retrieve data and store it in the $_SESSION array.
From one page, I did a "print_r" on $_SESSION and there are 423 session variables / arrays set. This might be even larger the more pages a user goes through. Some of these variables (but probably less than 10%) are used on almost every page. Then, there are some (maybe 25% which are only uses on very occasional pages). And almost every page uses some combination "get_xxxx_info.php" routines.
So, the general question is: what's the relative trade-off of consuming RAM with too many session variables vs using computational time to retrieve data from database tables?
What's a good way to start to get my arms around this?
Thanks!