Determining whether or not to use EJB simply on a performance basis can be very illusive. The overall performance of a distributed system is determined by many things, not the least of which is the ability for the system to scale.
EJB provides a modular framework for systems, allowing them to be distributed across many hardware and software platforms solving most scalability needs.
EJB vendors also typically use caching and pooling techniques to handle heavy workloads effectively.
With that said, there are a number of factors aside from scalability to keep in mind when making the decision to use EJBs or not. Some of these are:
- EJB is a good choice if your system needs transaction management and/or a robust security model.
- EJB might not be a good choice if your system is anticipated to be handling a low number of users, you are almost exclusively a non-Java shop or you find yourself making architecture decisions around the licensing fees of an EJB container vendor.