4 Replies Latest reply on Dec 4, 2009 10:17 AM by Manik Surtani

    Distributed cache and CacheStore

    Jarek Odzga Newbie

      Hi,

      Let's say I have 5 nodes in my clustered cache and I am using distributed mode.
      1. How do I configure backup for high availability, so that if one node goes down, other nodes will take responsibility for the lost node?
      2. If I configure CacheStore, are all nodes assuming there is one single CacheStore instance, meaning centralized point, where data is stored, or are they assuming that each node has it's own CacheStore instance?

      Best regards
      Jarek

        • 1. Re: Distributed cache and CacheStore
          Manik Surtani Master

          Using distribution in itself will maintain backups of data. Setting the numOwners parameter helps you configure just how many copies are maintained in the system.

          Regarding cache stores, you have a choice. If you configure the cache store with shared="false" then the assumption is that each node has its own local cache store (e.g., on a local file system). If shared="true" then it is as though you have a shared store, such as a JDBC database.

          • 2. Re: Distributed cache and CacheStore
            Jarek Odzga Newbie

            Hi Manik,

            Thanks fro such fast answer. I have a followup question. How is CacheStore used if I have shared="false" set? What are the main differences between those two modes?

            Great job!
            Best regards,
            Jarek

            • 3. Re: Distributed cache and CacheStore
              Juha Heljoranta Newbie

               

              "yahro" wrote:
              Hi,

              Let's say I have 5 nodes in my clustered cache and I am using distributed mode.
              1. How do I configure backup for high availability, so that if one node goes down, other nodes will take responsibility for the lost node?
              2. If I configure CacheStore, are all nodes assuming there is one single CacheStore instance, meaning centralized point, where data is stored, or are they assuming that each node has it's own CacheStore instance?

              Best regards
              Jarek


              Hi, I am not an expert on this matter but:
              1. You can use numOwners to define the number of "backup" nodes, default is 2. Even if you set it to 1 the rest of the nodes will automatically take over (but in this case you have to have a CacheLoader defined for truly transparent takeover).
              2. Configure loaders shared=true if you have centralized persistent storage or set it to false if each cache node should maintain their own persistent storages.



              • 4. Re: Distributed cache and CacheStore
                Manik Surtani Master

                 

                "yahro" wrote:
                How is CacheStore used if I have shared="false" set? What are the main differences between those two modes?


                In a cluster, a write is broadcast to everyone (repl) or to a subset (dist). When it comes to cache stores, if shared = false, everyone who receives a write will propagate the write to its cache store. If shared = true, then only the node where the write is invoked propagates the write to the cache store, preventing unnecessary, repeated writes of the same entry to the store.

                This diagram pertains to JBoss Cache and not Infinispan, but the concept of shared and non-shared cache stores are similar:

                http://www.jboss.org/file-access/default/members/jbosscache/freezone/docs/3.2.1.GA/userguide_en/html/cache_loaders.html#d0e3044