• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

application scope or/vs database

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"/>
GLOBAL.save("[username].INFO_1",INFO_1);
...
GLOBAL.save("[username].INFO_n",INFO_n);

*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?

Notes:
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.
 
Hang a left on main. Then read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic