3 Replies Latest reply on Dec 22, 2011 9:00 AM by Wolf-Dieter Fink

    Using jboss with multiple independed databases - Clustering

    ~= ziggy =~ Newbie

      I am looking into setting up a simple test for a clustered environment using Jboss and a MySql database.

      I would like to setup a clustered application server configuration and a clustered database configuration on two sites. I have been googling around trying to find information on how to set this up but i think most of the information i am seeing relate to load-balancing and failover type configuration.


      The setup i am thinking of is slightly different (But i dont know what it is called). This is described below:


      Site A: appserver1, appserver1_standby, db1, db2_standby

      Site B: appserver2, appserver2_standby, db2, db1_standby


      The clustered application server on Site A can use either db1 or db2 depending on some business rules. Most of the documents i am seeing describe a situation where the application server will only use db1 and only use db2 in case of a failure. This is not i want. All databases on all sites are live databases and each application server will use the relevant database depending on some rules.


      Does anyone know what this kind of configuration is called? Does Jboss support this kind of configuration? Is this something that is taken care of by the application server or is it the responsiblity of the persistence layer(JPA etc)?

        • 1. Re: Using jboss with multiple independed databases - Clustering
          Wolf-Dieter Fink Master

          I'm not sure about your requirements.

          Does appserver1 and appserver2 build a cluster?


          If you have two databases how you might control whether the data are in sync? Or do you have two different contents for different clients (with the same table structure) to ensure privacy?

          I would say that such scenario is the responsibility of the persistence layer.

          Another idea can be to implement your own JCA layer and decide here based on business data which db you use, but there might be cheaper solutions

          • 2. Re: Using jboss with multiple independed databases - Clustering
            ~= ziggy =~ Newbie

            Actually there was a mistake in the configuration above. Both appservers on each site make one one appserver cluster.


            Site A: appserver1a, appserver1b, db1, db2_standby

            Site B: appserver2a, appserver2b, db2, db1_standby


            db1 and db2 will make up one database cluster. The database cluster will manage the data replication. The problem i am having is i want each application to talk to both db1 and db2. So if appserver1a writes to db1, the database will be replicated to db2. If it writes to db2 the data will be replicated to db1.


            The data replication will be taken care of by the database layer. What i am not sure of is how to configure the application server to talk to both databases depending on some business rules.

            • 3. Re: Using jboss with multiple independed databases - Clustering
              Wolf-Dieter Fink Master

              If the data is replicated why there is a need to decide depend on business rules?

              Do you mean db1 == db1_standby? just as standby configuration for that server?


              But as I said, you can use two different persistence.jar files which uses different DS or you implement a JCA connector (which might not be trivial).