Re: what's better way to store a million keys in mem?




steve wrote:
On Mon, 17 Jul 2006 22:11:03 +0800, John_Woo wrote
(in article <1153145463.724590.206480@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>):

Hi,

A application, needs to check whether a user already logined, by
looking at static var in memory.

I don't have good idea. what's doing is, use Hashmap <not sure
Hashtable is better interms of inserting/removing/finding> to store ID
<string> -- key and status <character> -- value.

question:
what the better way to implement this goal, it should support up to 1
million of keys, in terms of high inserting/removing/finding, and
happened more frequently.

--
Thanks
John
Toronto


this will not scale with a single CPU, you will need multiple cpu's and
servers , if you tend to have a million users. and if you use multiple
servers you cannot store the keys in memory, unless you share the memory
between processors.
so therefore you are looking at some sort of database or shared disk storage.
something like oracle , will allow you to have multiple physical servers &
cpu accessing the same database, as if it is a single entity, you can even
partition the database into areas of say 100,000 so that the loading on the
diskdrives is partitioned and spread evenly between the different cpu's.



Steve

Thanks Steve, that sounds.
Currently we have multi-cpus, may use multi-server later, but still no
database designed
for holding the login-status.

Can u tell more about how to use shared disk in java, how to test it?

--
John

.



Relevant Pages

  • Re: T2000 performance Vs V240
    ... > "CoolThreads" servers for a spin yet? ... as they present themselves as multiple ... They scale very well,. ... lots of memory bandwidth. ...
    (comp.unix.solaris)
  • Re: How many companies are buying new AS400s - None.? They are buying new System i5 solutions.
    ... The original architecture of the System i family was designed and built as a multi-user _database_ system; ... the AS/400 was able to surpass the amount of OLTP work on many other servers; much like the zSeries does -- many technologies that are included beyond just fast spinning drives and high Mhz that get lots of work done. ... The work is divided across jobs that can be pooled in separate subsystems across which memory allocations & restrictions can be applied. ... there are many examples of customers getting very fast query response times with DB2 for i5/OS as compared to other databases. ...
    (comp.sys.ibm.as400.misc)
  • RE: Access Startup Speed Degradation
    ... closing the same app over and over ate up memory. ... Do all users of the database must have at least read, write, and modify ... A specific application is started, run, and closed multiple times by ...
    (microsoft.public.access.setupconfig)
  • Re: Multiple databases - best performance scenario
    ... My company has the need to manage data for multiple customers. ... Multiple small physical servers connected to SAN ... When I'm using the word database ...
    (comp.databases.oracle.server)
  • Re: whats better way to store a million keys in mem?
    ... looking at static var in memory. ... servers, if you tend to have a million users. ... and if you use multiple ... so therefore you are looking at some sort of database or shared disk storage. ...
    (comp.lang.java.programmer)