vendredi 30 janvier 2015

Optimizing data driven web application

I've built a simple web application using Java Server Faces (JSF) where I have a web page with a link and when I click that link, I just go to the database(MySQL) and fetch a list of items and would display in the web page. I've used Hibernate as an ORM tool.


I just have total of 10-15 entries in the database table that I query and the hibernate query is like "from myObject" which returns all the entries in the table.


Now, I'm trying to improve the performance of this application by limiting the number of queries to the database on every click on that link.


So I started learning about hibernate first level caching, second level caching, and Ehcache. Now I've some basic understanding on how they work.


Here is my question


Question : Let's say that the users of this application are divided into n groups-g1,g2,...,gn and each group has m users. When a user from group g1 clicks that link, I want to show a list of items specific to that particular group g1. Basically I want to show different list of items for different groups of users when they click on the link in the web page. As I want to show the same list of items to users in the same group, I want to limit the calls to database when the users from same group click that link. It would be great if some one could give their suggestions or give me some pointers that would help me go forward.


It is the same object that holds the data shown for all the user groups. There are adds, updates, and deletes to Entries(list of items shown in the web page) in the database. The list of items shown to the user is not static.


Aucun commentaire:

Enregistrer un commentaire