Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Store session states in database?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

e3stone
Average Member

USA
885 Posts

Posted - 10 August 2002 :  05:03:07  Show Profile  Send e3stone an AOL message
If we were to store session values in a temp table in the database, wouldn't this be more efficient than using session variables? I had thought of this and then read a blurp about it on this website: http://www.sql-server-performance.com/asp_sql_server.asp (about halfway down) I did a search on this forum and I couldn't locate a topic about it. I'm sure it's been spoken of before, though. Are there any +'s or -'s to this technique (as long as connection pooling is properly done)? I noticed that IdealBB does this (at least it looks like they do)

<-- Eric -->

Deleted
deleted

4116 Posts

Posted - 10 August 2002 :  06:51:07  Show Profile
I think the keyword on that link is "retreive it later when needed". If you are using the info on every page (like the quick JumpTo select data in v3.4) the performance loss will be much higher.

Similar idea was used in Active Users MODs (I only know v3.x) and was creating stress on database if there a lot of users online. You also need to implement "session expiration" there.

E.g. a shopping cart is much less dynamic than a forum. Also a shopping cart may need to save the data anyway...

(Hey, include signature is turned on by default :)

Stop the WAR!
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 10 August 2002 :  14:26:00  Show Profile  Visit Nathan's Homepage
Actually, I was just discussing this with Frutzle yesterday. All the queries for logging a user in and grabbing spacific info about that user could be eliminated for every page load except the very first one, thats about 5 queries if i'm not mistaken, just by storeing the seesion state in a TABLE_SESSIONS table. Which can double as an active users table.

And I dont mean "Retreive latter when needed" I mean retrive it all at the top of every page, just like it is now, but with only one query not 5.

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 10 August 2002 :  15:25:01  Show Profile
Because this info is only available when the server is online, i.e. no need to store it into database, you even can use the application variables for this purpose. Especially if you don't keep unnecessarily large info on every user.

This way you can drop the number of database calls to zero.

As you know, application variables can also keep arrays, and are much more speedy than database calls, although a lot slower than using simple variables.

Stop the WAR!
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 10 August 2002 :  15:45:27  Show Profile  Visit Nathan's Homepage
You load up that application object with 300 active sessions and your servers gonna be crying "M.M.Momma!"

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 11 August 2002 :  01:00:26  Show Profile
Exactly ! But I was not talking about complete sessions...

One more reason to use database on large scale sites can be the pre-dot-NET issue of clustering...

Stop the WAR!
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 11 August 2002 :  01:59:27  Show Profile  Visit Nathan's Homepage
Thats a good point, Classic ASP sessions don't function in clusterd environments.

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 11 August 2002 :  02:49:56  Show Profile  Visit Gremlin's Homepage
quote:
Originally posted by Nathan

Thats a good point, Classic ASP sessions don't function in clusterd environments.



They do using Session Affinity but that can have a negative impact on the Load Balancing.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07