which type of bean is more scalable and why?


EJB design: which type of bean is more scalable and why?

  1. hey there!!

    Are there any good resources over the net (or otherwise), that discuss the scalability issues with respect to session beans, i.e whether stateful or stateless beans are more scaleable over one another ?

    And if the two types of beans really offer different levels of scalability, are there any rules of thumb which can guide in choosing among them, depending on the application scenario?

    thank you
    shahid mohd
  2. Stateless beans are more scalable. Since there are no states associated with the bean, a single bean instance could be re-used to serve multiple client requests.

  3. As Digit mentioned right, stateless session beans are more scalable. But the crux is, that you mostly have any state and that you have to decide, whether it is better to use stateless session beans with state objects as input and return type params or to use stateful session beans instead. This question is of high importance and very interesting as Sun demands to use Stateful session beans and Microsoft stays at the contrast in saying that you never need a stateful session bean. I think you have to test it and make your own decision based on the real problem you have upon higher scaleability with more net traffic (slsb + state objects) or less scaleability with reduced net traffic (sfsb).