1 Reply Latest reply on Jan 17, 2006 11:48 AM by hmesha

    Database replication & cache loaders

    pbanta

      Hi,

      Let me apologize in advance for this question. I'm new to J2EE and I know that I don't fully understand all the terminology and it's likely that I'm confusing terms and concepts. Nevertheless...

      I want an architecture like the following with the requirement that all data must always be in cache.

      I have multiple application servers running in multiple geographic locations with caches and persistent storage. Each AS has its own persistent storage. To keep the example simple, let's say I have locations A and B.

      I have an application, Xa, running at location A and it is writing to cache at A and the writes are also persisted in the database at A. The databases replicate data using the replication feature of the database. So if data is written to the database at A it is replicated in the database at B. But now the cached data in B is stale.

      1. At location B how do I detect that data has changed in the database and load it into the cache at B?

      2. Is this something that a cacheloader can do?

      3. Is there a best practice for this type of scenario?

      Thanks in advance for the help.

      Regards,

      Paul

        • 1. Re: Database replication & cache loaders
          hmesha

          Hello pbanta,

          Here's the answers to your questions:

          1. At location B how do I detect that data has changed in the database and load it into the cache at B?


          You have to use JBoss Clustering for A and B. that way, when data changed on A, the cluster will notify B to re-load the cache from the cache loader store.

          2. Is this something that a cacheloader can do?


          CacheLoader is a persistance/passivation store for the cache tree and is not in control of the cache. so the cache loader can't do anything other than storing/loading to and from the cache loader store

          3. Is there a best practice for this type of scenario?


          Look at JBoss Clustering examples at http://jboss.com/developers/projects/jboss/clustering

          Hope this helps

          - Hany