Hello members of the Javaranch community.
I have this problem. Currently we have an ASP reporting application. It updates the information it shows by calling databse stored procedures on a specific time interval. We are now planning of converting this application into a
Java application. My boss suggested to me that since the information that we retrieve from the database does not update that often, maybe we could just store these information in our application's memory. The initial plan was to have a cron job run every 5 am in the morning which would query in database and transfer it in our application's memory. We would then just have a listener in our app which connects to a socket from an external system to detect changes in stored data and just update it our memory. Our "memory" would be composed of Java collection classes such as Maps and Lists which stores records in the database and we are reading about 10 to 20,000 records each day. We would retrieve all these records for a specific day and just do "lazy caching" for specific user queries.
I had feedback from some of my colleagues and they say that having it implemented in the memory is much too risky. A lot of them did the same thing before and encountered a lot of outOfMemory exceptions. On the other hand, having our application run complicated queries from the database for short periods of time wherein the actual data does not update very often may also not be a good idea. It could take up resources and downgrade performance of other applications connecting to the same database.
I hope you people can help me to decide on this if ever you've been in this dilemma before. I also want to know what KEY factors should I consider in making my decisions...or maybe suggest to me some Commercial profiling tools I could use to measure performance from both choices.
What would you suggest? I'd appreciate any form of help. Thank you very much.