-
1. Re: Caching in web application
schmyrczyk Mar 3, 2013 5:31 PM (in response to tausif.razi)Hello Mohammad,
Do you already know which version of JBoss Cache or Infinispan are you going to use?
If you are not sure: On which JBoss version is your web application running?
Regards,
Lukas
-
2. Re: Caching in web application
tausif.razi Mar 4, 2013 12:12 AM (in response to schmyrczyk)Hey Lukas,
Hope u r doing great.
I am new to caching itself forget about JBoss.
So I need some important information and knowledge before I start implementing it in my project.
We are planning to use CouchBase .But , still we are looking for a better option.May be JBoss cache we will use.
But before that I need to understand about the caching as a whole.
Regards,
Tausif
-
3. Re: Caching in web application
schmyrczyk May 8, 2013 6:50 AM (in response to tausif.razi)Hey,
at first you should gather some information about the topic cache itself.
There is a good explanation at wikipedia (https://en.wikipedia.org/wiki/Cache_(computing)).
I am not familiar with CouchBase. But since it provides key-value based access it sounds like a mix of a cache and a database.
Most java cache implementations are key-value-based. So you can access them like a map.
Here is an example how to access an infispan cache instance (Source: https://docs.jboss.org/author/display/ISPN/Getting+Started+Guide#GettingStartedGuide-5minutetutorial):
38.// Add a entry39. cache.put("key","value");40.// Validate the entry is now in the cache41. assertEqual(1, cache.size());42. assertTrue(cache.containsKey("key"));43.// Remove the entry from the cache44. Object v = cache.remove("key");45.// Validate the entry is no longer in the cache46. assertEqual("value", v);In the past I have also worked with EHCache and JBoss Cache. They are used in a similar way like Infinispan. I have also to mention that there is no "best" cache. You have to evaluate some cache implementations for you project because it depends on a lot of aspects like access speed, clustering capabilities, caching algorithms, etc.
For further information you could look up the following websites:
http://www.coderanch.com/how-to/java/CachingStrategies
http://infinispan.blogspot.co.uk/2010/02/infinispan-as-local-cache.html
But do not forget evaluate your desired cache in order to get the best results for your application.
Regards,
Lukas