4 Replies Latest reply on Jan 7, 2008 8:00 PM by manik

    How to use fully-eplicated and buddy-replicated caches with

    ne_vasya

      Hi,

      I have a case where I need to fully replicate some data, but not all.

      I understand that I could configure 2 different caches, but that would imply that I need to configure 2 different JGroups channels which makes me a bit uneasy for following reasons:

      1. What if at some point 2 JGroups channels will have different topology for some reason (should not happen, but nevertheless it's possible).

      2. If I configure 2 caches, then I get double PING traffic which I would like to avoid.

      Is there any way 2 caches could reuse the same JGroups cluster?
      Can I achieve this with options override feature?
      Can I use options override on per-node level?

      Thanks in advance.
      Dmitriy Setrakyan
      GridGain Systems

        • 1. Re: How to use fully-eplicated and buddy-replicated caches w
          fredrikj

          Why don't you just use separate regions in the cache?

          I.e.:

          root {}
           /data_a
           /... // first data set here
           /data_b
           /... // second data set here


          That way you use one cache for your data.

          • 2. Re: How to use fully-eplicated and buddy-replicated caches w
            ne_vasya

            I initially intended to use different regions under root, but can I have different replication policies for different regions?

            For example, can I have one region with full replication and another region with buddy replication?

            Thanks,
            Dmitriy

            • 3. Re: How to use fully-eplicated and buddy-replicated caches w
              manik

               

              "ne_vasya" wrote:
              I initially intended to use different regions under root, but can I have different replication policies for different regions?

              For example, can I have one region with full replication and another region with buddy replication?


              Dmitriy, no this cannot be done at the moment. We are considering adding more configurability to regions (JBCACHE-64).

              - Manik



              • 4. Re: How to use fully-eplicated and buddy-replicated caches w
                manik

                 

                "ne_vasya" wrote:

                I have a case where I need to fully replicate some data, but not all.

                I understand that I could configure 2 different caches, but that would imply that I need to configure 2 different JGroups channels which makes me a bit uneasy for following reasons:

                -- SNIP --

                Is there any way 2 caches could reuse the same JGroups cluster?
                Can I achieve this with options override feature?
                Can I use options override on per-node level?


                Yes, 2 Cache instances can share a single JGroups channel using the JGroups Multiplexer. There are sample configs in SVN.

                And here's a wiki page with more info on the multiplexer: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheMultiplexer

                In a nutshell, with the multiplexer, a single JGroups channel is created and shared among several cache instances. That way, one cache can be configured to use BR and the other can use total replication.