in reply to Re^2: Data store and threads
in thread Data store and threads

Yes, 2M. I can't store all data in memory.

Why not? A hash containing 2 million keys takes around 65 MB of memory:

undef $h{ 0+ int rand 2**32 } for 1 .. 2e6;; print scalar keys %h;; 1999519 print total_size \%h;; 67353411
assuming that i need to write/search through this data rapidly from several threads

Can you say a little more about what you are doing with this data?

What would you be writing to it?

Do changes need to persist beyond the life of the program?

How many threads?

How rapidly?

I just need to check presence of certain digits in this db.

Do you mean numbers rather than "digits"?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"I'd rather go naked than blow up my ass"