• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is storing session attributes effecient  RSS feed

 
Bling Chen
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm wondering if storing session attributes in a web application would hinder on any performance issues?

Also, I'm interested in hearing opinions on the best practice -- if you're trying to share simple String values in a Struts framework.

Thanks!
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Used sparingly placing objects into the session will not be a problem. WHenever possible, you sould place them in the request instead of the sesion. That way they get cleaned up by themselves.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, welcome to the ranch!

Almost all the apps my company runs for internal and external users have some session information. It is good to keep session data to a minimum, but don't spend a lot of time and effort optimizing it unless you know it's causing trouble.

When we run servers in a cluster we use session persistence and write session data to a database. If one server fails users will hit another server on the next request, and the new server can retrieve the session just like nothing happened. That database write is a much larger hit than putting something in memory, and the applications still perform well enough.
 
Bling Chen
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Much Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!