Link to home
Start Free TrialLog in
Avatar of wsyy
wsyy

asked on

Java to save big hashmap object in file instead of database

Hi,

I have encountered an issue mostly related to the MongoDB io.

I need to read a large number of records out of MongoDB whenever there is a new record coming in and this new records will cause every records to change in the DB.

So I am thinking of a solution that I read all the records once, convert them into an HashMap object, modify the object with the new record, and then save the hashmap object to hard drive.

I wonder if the solution is feasible or functionally doable.

Thanks
Avatar of for_yan
for_yan
Flag of United States of America image

why not ? Serilaize and store HashMap to drive, and then read it and modify when necessary. and strore again.
The question is how fast it would be in comparison with database. Very well may be faster, but that is always a matter of experimenting.
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CEHJ
Why not write the new stuff with Mongo?
Avatar of wsyy
wsyy

ASKER

Mongo IO has been an issue so it is not feasible.