Discussion:
[jboss-user] [JBoss Cache] - Caching in web application
Mohammad Tausif Razi
2013-03-03 16:57:30 UTC
Permalink
Mohammad Tausif Razi [https://community.jboss.org/people/tausif.razi] created the discussion

"Caching in web application"

To view the discussion, visit: https://community.jboss.org/message/800473#800473

--------------------------------------------------------------
Hey,
I think you guys are making a pretty good forum.
Since , I am new to caching I need some help in understanding cache in general (What is caching ?? adv n disadv of caching).
And how can I implement caching in my web application.
Please let me know about the tutorials or any relevant documents you guys have.

Thanks,
Tausif
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/800473#800473]

Start a new discussion in JBoss Cache at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2052]
Lukas Schmyrczyk
2013-03-03 22:32:05 UTC
Permalink
Lukas Schmyrczyk [https://community.jboss.org/people/schmyrczyk] created the discussion

"Re: Caching in web application"

To view the discussion, visit: https://community.jboss.org/message/800485#800485

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/800485#800485]

Start a new discussion in JBoss Cache at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2052]
Mohammad Tausif Razi
2013-03-04 05:12:43 UTC
Permalink
Mohammad Tausif Razi [https://community.jboss.org/people/tausif.razi] created the discussion

"Re: Caching in web application"

To view the discussion, visit: https://community.jboss.org/message/800504#800504

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/800504#800504]

Start a new discussion in JBoss Cache at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2052]
schmyrczyk
2013-05-02 19:21:11 UTC
Permalink
schmyrczyk [https://community.jboss.org/people/schmyrczyk] created the discussion

"Re: Caching in web application"

To view the discussion, visit: https://community.jboss.org/message/811308#811308

--------------------------------------------------------------
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) 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 a infispan cache instance (Source: https://docs.jboss.org/author/display/ISPN/Getting+Started+Guide#GettingStartedGuide-5minutetutorial https://docs.jboss.org/author/display/ISPN/Getting+Started+Guide#GettingStartedGuide-5minutetutorial):

38.       // Add a entry
39.       cache.put("key", "value");
40.       // Validate the entry is now in the cache
41.       assertEqual(1, cache.size());
42.       assertTrue(cache.containsKey("key"));
43.       // Remove the entry from the cache
44.       Object v = cache.remove("key");
45.       // Validate the entry is no longer in the cache
46.       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 factors 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://www.coderanch.com/how-to/java/CachingStrategies
http://infinispan.blogspot.co.uk/2010/02/infinispan-as-local-cache.html 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
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/811308#811308]

Start a new discussion in JBoss Cache at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2052]
Loading...