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
wsyyAsked:
Who is Participating?
 
for_yanConnect With a Mentor Commented:
If your process is the only one which uses this data that may well be more effective
0
 
for_yanCommented:
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.
0
 
CEHJCommented:
Why not write the new stuff with Mongo?
0
 
wsyyAuthor Commented:
Mongo IO has been an issue so it is not feasible.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.