Re: what's better way to store a million keys in mem?
- From: "John_Woo" <john_woo@xxxxxxxxxx>
- Date: 17 Jul 2006 17:01:00 -0700
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
.
- References:
- what's better way to store a million keys in mem?
- From: John_Woo
- Re: what's better way to store a million keys in mem?
- From: steve
- what's better way to store a million keys in mem?
- Prev by Date: Re: inner class and static
- Next by Date: Re: The Right Level of Patterns
- Previous by thread: Re: what's better way to store a million keys in mem?
- Next by thread: Referencing the base method
- Index(es):
Relevant Pages
|