• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Ask] How much space for session in tomcat server?

 
Leonardo Carreira
Ranch Hand
Posts: 489
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends...

i want to develop an application..
its application is like a ecommerce application...
for the shopping cart which use List<Object[]>, i decide to save it in session...
so user can insert, update and delete the shopping cart...
is it a good choice?..

or i have to save shopping cart current users in database?..
which one is good choice for keep the performance tomcat server?..

AFAIK i think if it many current user, or if it many user which have the "big" shopping cart,
is it can decrease performance of tomcat server?..

Thank's before
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't imagine that any one user can put enough in a shopping cart to cause an issue. So how many simultaneous users are you expecting? 10? 100? One million?

I'd also base the decision on whether I wanted the contents of the cart to persist across multiple browsers or sessions.
 
Leonardo Carreira
Ranch Hand
Posts: 489
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe assume the current user its arround one hundred..

and now how we manage all shopping cart it?..
example..
assume each current user is buying 60 items..
and i want to save it in List<Object[]>, array of object with dimension 60x7..

how to manage it?..
i want to save them in Session.. is it possible?..
cause i want to decrease hit to database..

Thank's
 
Paul Clapham
Sheriff
Posts: 20983
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course you can save that data in the session. It's a trivially small amount of data. Is there a reason why you want to reduce the number of database accesses?
 
Leonardo Carreira
Ranch Hand
Posts: 489
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AFAIK I think i must to reduce the number of database access because i think it can decrease the performance's tomcat server..

which one is more better for keep the server's performance?..
should i save that data in the session or i save that data to database?..

Thank's
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You think it will decrease performance? You might want to look up the concept of premature optimization.

The numbers we are talking about here are trivial and you shouldn't really need to worry much about performance. Rather, design for clarity and the functionality you require.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic