In an application where there are say 1000 simultaneous users, would it be advisable to call a web service as a part of the request or fetch data from web service offline using a job and store it in your database?
I am confused between these two options: 1) Call the web service as a part of your request: user clicks link, page submits to controller, web service called (substantial data is fetched). Data is displayed to user.
2) Create a timer bean/ batch job that calls the service every 15 minutes and fetches data updates for all users, update the database. User may not see latest updates(updates will be 15 min old) but this is acceptable.
Wouldn't way 2 allow for better performance always? Is there a situation in which calling online service may be more advisable?
Finally, if both the service code and client code are java, would you rather use JNI-RMI instead of web service ?