| Author |
application scope or/vs database
|
Alan Yap
Ranch Hand
Joined: Feb 24, 2006
Posts: 32
|
|
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.
|
When I'm not coding.. I do THIS
|
 |
 |
|
|
subject: application scope or/vs database
|
|
|