2 Replies Latest reply on Apr 14, 2009 3:36 PM by cpslo1999

    Best Practice for multiple applications

      This is hopefully an easy enough question to answer...

      I am trying to determine what is considered the best practice for deploying two (basically unrelated and) different J2EE applications to the same hardware server.

      1) Deploy both applications to the same instance of JBoss
      2) Deploy each to its own instance of JBoss
      3) Something else?

      It seems that (1) would require each application to "know" about its specific data source (as opposed to using DefaultDS), and that (2) could potentially involve much more overhead and duplication.

      Thanks,

      Josh

        • 1. Re: Best Practice for multiple applications
          peterj

          Well, one best practice is to definitely not use DefaultDS for your apps. Leave the JBoss AS services with DefaultDS (though you should use a database other than Hypersonic for it), and each of your apps should use their own data sources, unless the apps are accessing the same data in which case they would want to use the same datasource. Actually, if the two apps are accessing the same data you probably really want one set of EJBs accessing the database with two web apps using that one set of EJBs.

          As to whether to run them in the same app server instance or in two instances, the answer to that depends on other factors. Such as:
          * If one of the apps runs into an issue and you have to restart the app server, is that OK as far as the other app (and its users) are concerned?
          * How much memory is on the host system and can it handle the large memory requirements for two app server instances?
          * Would there be an issue with using two different HTTP ports to access the two applications (this can often be hidden behind and Apache HTTPD server)?

          Thus you see it is more of an administration question as to which is more appropriate.

          • 2. Re: Best Practice for multiple applications

            Thanks for the quick reply!

            So if I may boil down your reply, it sounds like if I have the hardware resources available to run them in different instances of JBoss, then I should do so.

            It sounds like the administration in the long run will be easier if I run them separately.