Debating Using Sessions To Save DB Load...Thoughts?
Posted: Mon Sep 14, 2009 12:35 pm
Hey,
I am building a website that will likely host 10,000+ users with screen names who will be logged in and use
the site often. One key function is using Geo IP where I can pull their city/state and that data comes in handy
every time they answer a poll question or view results. Long story short, I was thinking that instead of using the DB
to pull that data every so often for a user, I should simply load those values into a session when they log in.
This way, if 10,20,50K++ users ever are at the site at once it's not hitting the DB each time I need to filter poll results
based on their city or state. By using a session which pulls these values only once during log-in, I am not needlessly
hitting the db over and over agian.
Thoughts?
Thank you for your time.
I am building a website that will likely host 10,000+ users with screen names who will be logged in and use
the site often. One key function is using Geo IP where I can pull their city/state and that data comes in handy
every time they answer a poll question or view results. Long story short, I was thinking that instead of using the DB
to pull that data every so often for a user, I should simply load those values into a session when they log in.
This way, if 10,20,50K++ users ever are at the site at once it's not hitting the DB each time I need to filter poll results
based on their city or state. By using a session which pulls these values only once during log-in, I am not needlessly
hitting the db over and over agian.
Thoughts?
Thank you for your time.