Hi All,
I need to find a way to improve performance of my application. here is the scenario,
Its a
J2ee application. The client will send the request to the
servlet (programmatic) after every 10 seconds. The servlet will query the database and return the results. Currently there are few users but in future when the user base increases, this approach wont work as there will be many concurrent requests and hence load on the database and the application.
I was thinking of writing a
thread which will ping the database after every 10 seconds and store the "Superset" of the data in an application wide object (e.g. a table structure in app context). The servlet will query this object instead of the database on each request.
Is it a right approach? Also in case of "Clustered Environment" will this work? My concern is whether app. context is replicated over clusters?
Can any one suggest me a better approach or tell me if I am missing something.
Any help is really appreciated
Thanks,
Sameer