Reputation: 29
Currently I am trying to figure out the best way to retrieve and save data.
I am working on a spring batch program with masters and slaves, and I was iterating through some data and saving into a hashmap. Originally I was just saving data into a hashmap, thinking I would never need it again, but it turns out I will need some of it in a later step.
It would be nice if I could just simply replace this hashmap with a namedcache. And use it in the step I created it in, and the following steps as well. However i'm worried it will cause excess overhead.
Should I keep the hashmap, and eventually iterate it into the cache for using later? Or should I just simply replace this hashmap with a namedcache?
Upvotes: 0
Views: 328
Reputation: 21483
I've used EhCache before in batch jobs to store static data (countries, billing codes, etc). It's not an unusual paradigm and works very well.
Upvotes: 1