Re: what's better way to store a million keys in mem?
- From: steve <steve@xxxxxxx>
- Date: Tue, 18 Jul 2006 06:02:45 +0800
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
.
- Follow-Ups:
- Re: 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?
- References:
- what's better way to store a million keys in mem?
- From: John_Woo
- what's better way to store a million keys in mem?
- Prev by Date: runtime config of ssl
- Next by Date: Re: Eclipse and Tomcat on Linux : possible ?
- Previous by thread: Re: what's better way to store a million keys in mem?
- Next by thread: Re: what's better way to store a million keys in mem?
- Index(es):
Relevant Pages
|