Integration inside applications: EJB vs WebServices ?

Discussions

Performance and scalability: Integration inside applications: EJB vs WebServices ?

  1. We are going to develope a big application with Java that needs a big sacalability (700 internal users and 5000 potential external users (extranet mode)). What kind of integration method do you recommended between modules of the same application ? Is better to use WebServices or RMI/EJB ?

    Is possible to use different application servers for the same application with J2EE-EJB implementation ? In this case is better to use RMI or WebServices ? (Example: One module running with JBoss and other of the same application running in BeaWebLogic )

    Thank you !!!
  2. We are going to develope a big application with Java that needs a big sacalability (700 internal users and 5000 potential external users (extranet mode)). What kind of integration method do you recommended between modules of the same application ?
    Is the usage of these application modules related in any way to the fact that users are internal/external? ie, will you have certain users accessing primarly only certain modules? Application module integration relies heavily upon usage, network architecture and server specifications.

    Is better to use WebServices or RMI/EJB ?
    If you have modules written in different languages/technologies talking to each other, then webservices. If some of these modules have to interact with external services (or future customers), then webservices. If the modules are all Java, hosted on servers in a gigabit ethernet LAN, then RMI. You might want to consider messaging as well.
    Is possible to use different application servers for the same application with J2EE-EJB implementation ?
    It is. But messy, and can be very difficult to manage.
    In this case is better to use RMI or WebServices ? (Example: One module running with JBoss and other of the same application running in BeaWebLogic )Thank you !!!
    Unless you have a real case for using different application servers, I wouldnt recommend it.


    Cheers
    M
    http://efil.blogspot.com
  3. different app server[ Go to top ]

    Is possible to use different application servers for the same application with J2EE-EJB implementation ?

    It is not required by the J2EE spec, so e.g. transaction propagation does not need to work between different vendor app servers
  4. In my opinion, you may use only one kind application server (JBoss OR WebSphere OR Weblogic), and follow this strategy:

    . At the beginning, deploy everything in just a JVM. In this JVM you may have all the code, including the presentation layer, the business logic, and the data access logic. Of course, doing this, you don't need RMI, IIOOP or SOAP to invoke classes, because all of then are going to run in the same process. If the 5700 users are going to start using the application gradually (for example, at the begining you may start with a pilot project with only 200 users) maybe you can use a production machine with only two processors.

    . If more and more users start using the application, you may add more processors to the production machine (this is usually called in jargon: 'vertical scalability'). If you get to a configuration with four processor, you may need to start a second JVM in the machine in order to use all the CPU resources. Both of the JVM must have all the application code, in order to avoid inter-process calls, because they tend to slow the response time. A third process (for example a web server) may dispatch the request to one of the two JVM, using some easy algorith such as round-robin.

    . If you start to stress your production machine, you may add a second machine with the same number of processors ('horizontal scalability'). Again, an external process (the web server) is the responsible to dispatch the work and send the request to one JVM or another.


    As you may observe, I don't recommend inter-process communication, because it has a performance overhead that is better to avoid. Forget all the ancient theories about having the web container and the ejb container in different machines because they just don't work (it is better to have all the code in the same JVM - when possible - and let the web server balance the requests).

    And of course, remember that you may use web services only if you need to access to external applications written in other languages such as COBOL, NATURAL or C. If you have all the modules written in Java, then they should run in the same JVM, and invoke the classes directly, instead of performing expensive network calls.


    Hope this helps,
    Jose Ramon Huerga

    http://www.terra.es/personal/jrhuerga