db lookups versus sessions
hello again all,
i have another newbie question... is it better to do a lot of db accesses to reread data, or should i store things i grab from a db into a session object to allow it to transition to new pages...
i could easily create a js object that represents some db record, read in the record from the db, and then store it in Session... i know that db accessing can be costly, but so can holding memory in the session (especially if i'm dealing with a large volume of objects coming from a db)...
ack to memory usage!
If you're talking about some main fields like key fields and the username and userlevel, I'd vote for session variables.
I will not suggest you to use Session objects to store bulk amount of data. If it is 2-5 small key values you want to be available on each page then you can use Session objects but if it is a bulk data and you do not require that on each and every page then better to use database communication that time. MEMORY is more expensive then database connections.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)