[infinispan-dev] Use of Inifnispan across data centers

Bela Ban bban at redhat.com
Thu Aug 5 03:29:11 EDT 2010


The other day I had an idea how we could use Infinispan across data centers:

Say we have 2 data centers: NYC and SFO. There are nodes A,B,C,D in NYC 
and W,X,Y,Z in SFO.

We'd like to use Infinispan in DIST mode with numOwners == 2, and 
ideally place 1 copy of a data in the NYC center and one in the SFO 
center. (Of course, this would also work with numOwners > 2, we'd just 
have to make sure the copies are distributed more or less evenly between 
the 2 data centers).

To make this work, there are 2 things that need to be done:

   1. The nodes in NYC and SFO have to be in the same JGroups cluster.
      This way Infinispan has insight into the membership and gets
      notified of changes. The cluster would usually be TCP based, but
      if there's multicasting available between the centers, then of
      course multicasting could be used, too.
   2. The nodes in NYC would have to have a logical name starting with
      "nyc-", the ones in SFO "sfo-".

#2 is needed by Infinispan as input into its consistent hash function in 
order to determine the nodes to store a given key/value. Say if we have 
a view of
{nyc-D, sfo-Y, sfo-W, nyc-B, nyc-C, sfo-Z, nyc-A, sfo-X}, then we could 
come up with a consistent hash function which knows that there are 2 
data centers and could place the nodes onto 2 different hash wheels and 
pick one from each (if numOwners=2).

Yes, I know #1 sucks, but until we've implemented the more advanced 
solutions (e.g. RELAY in JGroups, data center replication in 
Infinispan), this seems to me a workable solution that could be 
implemented in a short time.

WDYT ?

-- 
Bela Ban
Lead JGroups / Clustering Team
JBoss



More information about the infinispan-dev mailing list