• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Storing visitors data

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic