How to set up custom caching?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Joost_Schouten
Posted On:   Saturday, March 29, 2003 02:30 PM

Hi, I'm building a webapp which does frequent database calls. Sometimes the calls are extensive and involve populating 1000s of beans. Let say I need to select all my 5000 users from my users table, the userBean holds the company he/she works for, retreived from the companies table, and the array of projects he/she is working on retreived from the projects table. As you can understand a lot of double calls are preformed, since a lot of people work on the same projects, or for the same company. I'm in the prosess of setting up a cache system that will save every bean retreived from the databse, and return it on the next call. However, the caching cannot exceed the span of one http request. Since on a next call the entry mig   More>>

Hi,


I'm building a webapp which does frequent database calls. Sometimes the calls are extensive and involve populating 1000s of beans. Let say I need to select all my 5000 users from my users table, the userBean holds the company he/she works for, retreived from the companies table, and the array of projects he/she is working on retreived from the projects table.


As you can understand a lot of double calls are preformed, since a lot of people work on the same projects, or for the same company. I'm in the prosess of setting up a cache system that will save every bean retreived from the databse, and return it on the next call. However, the caching cannot exceed the span of one http request. Since on a next call the entry might have changed.


Now here is my question. Is it common practice to cache my entire database upon startup, and modify the databse and cache when changes occur. This should significantly decrease the prosessing time right?


Any comments and/or recomendations on how to optimize data retreival through caching the entry beans retreived.


Thanks,

Joost

   <<Less

Re: How to set up custom caching?

Posted By:   Jeanne_Boyarsky  
Posted On:   Sunday, March 30, 2003 05:34 PM

Actually, caching the whole database is unlikely to be faster. By doing this, you are basically reinventing the database. A database product is going to be faster at looking up large quantities of data than your java code will.
About | Sitemap | Contact