4 Replies Latest reply on Sep 14, 2007 8:04 AM by Manik Surtani

    Why ClusteredCacheLoader?

    Bruce Springfield Apprentice

      If you have a replicating cache, why bother with a ClusteredCacheLoader? What is the difference?

        • 1. Re: Why ClusteredCacheLoader?
          Brian Stansberry Master

          Couple things come to mind; there may be others:

          1) Avoid having to do an initial state transfer, which can be expensive if there's lots of state.

          2) Avoid overhead of writing to a persistent store if you want to support recovering data that's been evicted. Note this is a less than perfect solution, as it's possible all nodes will evict the data, and thus it won't be recoverable.

          • 2. Re: Why ClusteredCacheLoader?
            Bruce Springfield Apprentice

             

            "bstansberry@jboss.com" wrote:

            2) Avoid overhead of writing to a persistent store if you want to support recovering data that's been evicted. Note this is a less than perfect solution, as it's possible all nodes will evict the data, and thus it won't be recoverable.


            So, ClusteredCacheLoader calls to another cache won't cause that cache to load the data from persistent store if the data has been evicted? Unlike a replicated cache?

            • 3. Re: Why ClusteredCacheLoader?
              Brian Stansberry Master

              You'd better test it, unless someone more intimately familiar responds.

              If you had a chaining cache loader and one of the cache loaders in the chain was a regular cache loader, then logically the cluster-wide get from the ClusteredCacheLoader should trigger a load from the regular cache loader.

              But the whole idea behind my #2 was saving overhead by not writing to a persistent store. So if you are writing to a persistent store, you're not getting that benefit.

              • 4. Re: Why ClusteredCacheLoader?
                Manik Surtani Master

                A clustered cache loader, if unable to find the result, will cause the chaining cache loader to consult the next cache loader in the chain, and load from disk.

                The benefit is *only* so that you don't need to rely on a state transfer to transfer initial state, but instead load this lazily using a CCL.

                The other reason for using a CCL is if you don't want any replication at all - i.e., caches are configured as LOCAL, but use a shared database as a cache loader. This way, you could use a CCL as well to prevent overloading your shared DB.