I have asked a question in Software Engineering Stack Exchange.

I am refactoring a project which loads its all data from the mongo to the Java HashMap. The system writes both in the map and the mongo but read from the map only. It is like some kind of persistent map! The problem with this architecture is that it is not scalable with regards to memory.

I am looking for a Java Map implementation which is disk-based (not limited by RAM size).

  • Why not switch to a cached based system using e.g. a WeakHashMap. First query if the entry exists, if it exists and the data exists use it, otherwise (cache miss) run the query in Mongo and then cache the data in the Map for the next query?
    – Robert
    Nov 29 '21 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.