Skip to content Skip to sidebar Skip to footer

Specific Caching Scenario For Web Application

I am making a web application that involves being able to grab specific computer logs from multiple department stores. The application is getting data from a SQL Server DB. At the

Solution 1:

Then the user can select a workstation, pick a day and month they want a log from and hit a submit button.

Based on this statement, I am assuming that the log for a particular day and month will not be updated once it has been written to the database.

So, As I get these results back in a ResultSet object do I iterate through them one by one and check if they're already in the cache?

It looks like using Hibernate with a second level cache and query caching would be a better option for you instead of using just a cache. Since your question is a high level question, I am not going to get into the details of what is Hibernate and how to us Hibernate and configure a second level cache and a query cache.

See this for more details on query cache. The article is a bit old but it did help me understand the basics of query caching.

And do you think it would even be wise to consider caching log info that was asked for on a certain day and month if it's in the past?

I don't think there is anything wrong in caching past data. The primary purpose of caching data is to make data required by your application available quickly when it is required. If accessing this data requires you to hit the database or read from a file everytime the data is required, a cache makes sense.

Post a Comment for "Specific Caching Scenario For Web Application"