Page 1 of 1

Session variables or DB query

Posted: Thu Dec 23, 2010 5:07 am
by karimyehia
Hello all,

I am not an experienced PHP/MySQL developer. I have been studying them for two weeks now but I have already made good projects and I think I am getting the hang of it. I just have a question for the experienced people. When people log in to websites like facebook for example. Do all their related information: messages, notifications, friend, images, etc get registered in session variables or is it just the userid and the DB is queried each time the user wants new information?
From a technical point of view, both can work, I am just concerned about the real world when databases are huge and millions of users might be querying the DB at the same time?

Thanks

Re: Session variables or DB query

Posted: Thu Dec 23, 2010 9:46 am
by Technical
karimyehia wrote:Hello all,

I am not an experienced PHP/MySQL developer. I have been studying them for two weeks now but I have already made good projects and I think I am getting the hang of it. I just have a question for the experienced people. When people log in to websites like facebook for example. Do all their related information: messages, notifications, friend, images, etc get registered in session variables or is it just the userid and the DB is queried each time the user wants new information?
From a technical point of view, both can work, I am just concerned about the real world when databases are huge and millions of users might be querying the DB at the same time?

Thanks
You should never stores any data in Session except session key.