High level questions about Infinispan inside AS7
darrellburgan Mar 15, 2012 9:07 AMI'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