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
Session variables or DB query
Moderator: General Moderators
Re: Session variables or DB query
You should never stores any data in Session except session key.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