Ulf Dittmer wrote:Sounds complicated. Why does it matter whether the file is served by a servlet or directly? Why not always serve it via the servlet? If performance is of utmost concern, the file contents can be cached in memory after it has been fetched initially, thereby avoiding disk access on all instances.
If you have an Apache in front of the app server, you could put the file into a directory that is handled by Apache, thus avoiding the cluster issue altogether.
Roberto Perillo wrote:So the problem is that there is some data that is generated externally, and since your application is in a clustered environment, it might be handled more than one time (i.e. the number of servers in the cluster), and if you save this set of data as a file, then it would exist in only one of the servers, and if a server different from the one the file is saved in handles a request, then the file won't be found.
Roberto Perillo wrote:Well, what you can do is, since this set of data is handled on regular intervals, you could create a Quartz job and configure it to work in a clustered environment