3 Replies Latest reply on Jul 19, 2011 5:35 PM by Sanne Grinovero

    Local index in for only one instance of the cache

    Sudheer Krishna Novice

      Hi,

       

      I have a usecase as follows.

       

      Node 1 - has a cache which is replicated into Node 2 using distributed mode.

       

      Node 1 does inserta and updates into teh cache very frequenctly.

       

      I have my business logic running in node 2 which is expected to do query on the cache. So i want querying capability only of node  2 and not on Node 1. Also i am fien to keep in memory indexes.

       

       

      Is there any configuration by which i can say , i need teh cache on nodes 1 and but , but indexed only on node 2 ?

       

      Can this be achived by loading differetn cache configurations for these two nodes (one says indexing enabled and teh other without)

        • 1. Re: Local index in for only one instance of the cache
          Sanne Grinovero Master

          Hi,

          yes but set indexLocalOnly=false and use REPL instead of DIST.

          Why are you using distribution if there are only two nodes?

          • 2. Re: Local index in for only one instance of the cache
            Sudheer Krishna Novice

            Thanks Sanne for the quick response.

             

            i am using distributed mode fo rteh following reason.

             

            I have many instances of S1 servrice in different nodes - catering to different products.

             

            And i have one instance of S2 service which needs to collect all this data across all instances of S1 service and do soem analysis of it.

             

            So i was planning to use distributed mode for all these caches with every instance of S1 sharing data with S2.

             

            Is there a better way of achiving the same ?

             

            Also teh S2 service is one which needs indexing because it doest write into cache , instead only reads from teh cache using diffferent queries .

            • 3. Re: Local index in for only one instance of the cache
              Sanne Grinovero Master

              To perform "some analysis" could the S2 service not use the Map/Reduce API instead of downloading all the data locally?

               

              It depends on how big the data on S1 is, if it can be stored all on a single node if you can use REPL indexing would be simpler to setup.

               

              If you need to use S1 configured as DIST, you'll need to separate S1 from S2 by using HotRod to make it possible from S2 to fetch the data stored in S1, but you will also need to configure S1 with a shared index and indexLocalOnly=true, and configure a clustered backend for the embedded Hibernate Search engine.

              1 of 1 people found this helpful