title: Single EAR? Or multiple EARs?
body: <p>We are in the process of developing a JavaEE 6-based application to be deployed on JBoss EAP 6.1.  The app has 2 primary presentation mechanisms:  A web admin console, and a RESTful service API.  On the backend, both the admin console and the RESTful service API rely on a series of EJBs for performing transactional logic and POJO services for retrieving data.  </p>
  
  <p>It is entirely possible that the performance and resource needs for all of these various layers may be different.  The RESTful services are rather thin and completely stateless, whereas the admin console is stateful and has more interactive functionality (and therefore more memory and processing required).  Since our EJBs perform our primary transactional business logic, they would require more processing power than our POJO data services that simply query the database.</p>
  
  <p>Given such a setup, would it make more sense to deploy a single EAR (in multiple appservers in a clustered configuration) with all of these components, or break down the individual components into separate EARs?  My thinking with separate EARs is that I could, for example, deploy more instances of the EJB services if I find there are scalability issues with them, even though the web console (for example) is scaling just fine.</p>
  
  <p>Given the fact that the scalability of each layer/component is different, what approach should I take?  Is the overhead of having to make remote EJB calls across EARs too high to consider such a model?  Any advice is GREATLY appreciated!</p>