2 Replies Latest reply on Feb 2, 2005 1:15 PM by ben.wang

    Single or multiple cache instances?

    rafaelsteil

      Hi,

      I'm going to integrate jboss-cache to my project, JForum (http://www.jforum.net), and I've some questions regard to cache implementation. Currently my objects are cached using maps and lists.
      The question is: should I use a single TreeCache (I will not use AOP) instance for all my cache entries, or as many as necessary? For example, let say I want to cache basic forum and category info, as well topic data for the first n topics in each forum.

      Currently I have a map instance where the key is the category id and the value is the category. Eeach category has a list a forums. For topic caching, I have a map indexed by forums, where each value is a list of Topics. This is handled by different classes.
      For jboss-cache, I'm not sure how make it. Should I use a single TreeCache instance and put all there, like

      /categories/ => category instance
      /categories//forums/ => forum instance

      /topics/<forum_id> => list of topics for that forum


      and so on, or should I have a treecache for categories, another one for topics and etc?

      Thanks,
      Rafael