• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing visitors data  RSS feed

 
Michal Glowacki
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am creating a web page, that is going to have about 30-50k customer accounts. When I was starting with it, about a year ago I decided to use session-scoped bean to store customer data. It's structure is something like this:

public class CustomerData {
Integer customerId;
String prefix;
String firstName;
String lastName;
Boolean isLogged;
...
[set of getters and setters]
}

It's great solution for me, because I just call method getCustomerData() at each page and I have all neccessary data. But I've started to worry about performance and memory usage. What do you prefer, is it good solution? What can happen when i will have about 20k customers at one time?

What are alternatives? Passing even reduced set of variables via session is quite tough, get context, get session, set attribute, then get context, get session, get attribute...

Thanks for all tips!
Michal
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your beans in session scope probably aren't taking much memory, so I don't think it would be a problem. There are multiple ways for finding out exactly how much memory the bean typically occupies (Google should give you many options).
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!