2 Replies Latest reply on Mar 20, 2012 3:38 PM by Darrell Burgan

    High level questions about Infinispan inside AS7

    Darrell Burgan Newbie

      I've read through everything I can find about configuring Infinispan under AS7, but all the dots are still not connected in my head. Hoping y'all can give me some good guidance on these high level questions.

       

      Background: we are using JBoss AS 7.1 with the Infinispan that comes with it (5.1.x). We are using Hibernate 4.0.1, along with Spring 3.1.0 and Spring Data (unsure of version), all hosted under Java 7. Back-end is MS SQL Server Enterprise 2008 v2. Database we are modeling contains several hundred tables. There will be multiple web servers and multiple app servers, in two separate vlans, that all need to share the same cache definitions. We are planning to set them all up under a common JBoss AS7 domain.

       

      1. What is the relationship of the HIbernate cache region name to the Infinispan named cache? Are they the same? Do they have to be? Is it best for them to be?

       

      2. Is it best to model each entity into a separate cache region, or is it best to set up a small number of cache regions and map entities to them?

       

      @Entity

      @Cache(region = "Users", usage = CacheConcurrencyStrategy.TRANSACTIONAL)

      @Cacheable

      @Table(schema = "dbo", name = "Users")

      public class User {

      }

       

      v.

       

      @Entity

      @Cache(region = "distribution-sync", usage = CacheConcurrencyStrategy.TRANSACTIONAL)

      @Cacheable

      @Table(schema = "dbo", name = "Users")

      public class User {

      }


      3. How/where do I tell JBoss the configuration we want to use in our production environment? We are not sure yet whether we want to use UDP multicast or UDP with Gossip Router. I've looked at the default setup in domain.xml and it seems much too simplistic for our needs. But I'm reluctant to start messing with it until I get some understanding of how the configuration should look. Does anyone have an example domain.xml they have set up that they can share?

       

      4. The usage of our entities will vary considerably. Some entities are primarily read-only, where each node in the cluster will often be referring to the same entries in the cache. Other entities are heavily read/write, where each node in the cluster will typically not be referring to the same entries in the cache. I'd love to be able to configure Infinispan differently for each behavior, e.g. replication cache for the read-only-ish tables and maybe distribution or invalidation cache for the read/write tables. How can I configure this, given there are several hundred tables in our schema?

       

      I know these are broad questions, but any advice you can provide would be helpful. I'm a bit lost at the moment. If there is a good reference for all this available somewhere, please let me know and I'll RTFM.

       

      Thanks!

      Darrell

        • 1. Re: High level questions about Infinispan inside AS7
          Galder Zamarreño Master

          Re 1. That's an internal detail, but FYI, each cache region is mapped to an Infinispan named cache which we control/configure internally.

           

          Re 2. Leave that to us - shouldn't have an impact on your app.

           

          Re 3. All configuration done is either done in standalone.xml or domain.xml. This part of the post might be directed to AS7 forum.

           

          Re 4. Personally, I'd worry about this later. Start with defaults and monitor the cache hits/misses that you get and then tweak accordingly. If you do need to tweak things per entity type, best is to take the "entity" cache within the 'hibernate' container, copy it giving it a different name and making your changes, and put that name in the cache region.

          • 2. Re: High level questions about Infinispan inside AS7
            Darrell Burgan Newbie

            Okay thanks for the info. For anyone else who has similar questions, I found the Marchioni book about AS7 configuration, deployment, and administration invaluable in helping me figure this out. Not trying to spam the book; there may be others of equal or greater quality, but it was very helpful to have a "how to" book for me.