Is it advisable to handle huge amount of data in Session

Posted by Thiru under ASP.NET on 9/9/2011 | Points: 10 | Views : 1107 | Status : [Member] | Replies : 3
Hi,

Is it advisable to handle huge amount of data in session to use for our further processes in web application?

I am expecting a detailed reason for the above question.

Regards,
Thiru.




Responses

Posted by: SheoNarayan on: 9/9/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
No, it is not.

Remember that Session object is created for each user. So if you have 100 KB data for a user and there are 5 users visiting your website, your server has to save 500 KB data. Think a scenario where you might have 100s of users then how much space is required.

Where to hold the data for further processing totally depends on your scenario, if the data has to be processed in a single request you can hold them into a variable.

If you have any further question on this, let us know.



Regards,
Sheo Narayan
http://www.dotnetfunda.com

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Thiru on: 9/9/2011 [Member] Starter | Points: 25

Up
0
Down
Fine nice answer thanks.

I have two question in this regard:
ONE:
I usually do like creating session variables and storing required data in it.
and after end of process or during log out i used Session.Abandon()
If so, i have to maintain huge memory in server if more users are in.
instead may i remove the unwanted session variables immediately after utilizing that as session("variablename")=""

TWO:
From your above answer i understand that its not advisable to handle data in sessions - fine.
what is your suggestion/advise to go other than session?

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 9/11/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi thiru,

I think you gave answer of your 1st question it self, you can do so remove individual objects from session as they are no more in use.

and for 2nd one:
If your data is used on same page between postbacks you can maintain them in Viewstates. and if you need to passed them between pages, then you can use querystrings as well.

Hi sheo sir,
Hope i gave right answer, plz add your valuable comments or suggestion or content if anything is missing.
i ll grate full to you for this.

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response