• Post Reply Bookmark Topic Watch Topic
  • New Topic

application scope or/vs database  RSS feed

Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've posted similar question but it was deemed unsuitable for this category but I still think the chances of it getting answered here is higher.

Each logged in user in my application will have his few info updated constantly (roughly at about 1 time each second). This will be done via a hidden iframe.

Method A) use application scope
store the updated info into application scope bean. Eg.

<jsp:useBean id="GLOBAL" scope="application" class="myVeryOwn.global"/>

*save is a function that puts the value into a hashtable inside global.

When he logs out, those info will be moved/transfered into the DB

Method B) use DB
directly store the info into the DB as soon as it change.

I know method B will put a heavy load on the sql connection, but I am just wondering whether things will get any more better/effecient if I employ method A.

Or are there MUCH better alternative?

1) the info to be recorded constantly are actually user/player map location. Must be updated as soon as he move.
2) Expected total number of user online at the same time to be around 20,000-50,000.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!