EJB Misconceptions
Resin 3.0

Features
Installation
Configuration
Web Applications
IOC/AOP
Resources
JSP
Quercus
Servlets and Filters
Databases
Admin (JMX)
CMP
EJB
Amber
EJB 3.0
Security
XML and XSLT
XTP
JMS
Performance
Protocols
Third-party
Troubleshooting/FAQ

User's Guide
Reference
Tutorials
Scrapbook

EJB Misconceptions
CMP Relations Catalog
CMP Performance
User's Guide
User's Guide
CMP Relations Catalog

Since EJB 2.0 is a dramatic change from previous EJB specifications, there are a number of preconceptions about EJB that no longer apply. With the new EJB 2.0 changes, EJB is now suitable for smaller web sites, including sites running on only a single server.

  1. Some Preconceptions about EJB
    1. CMP is about Database Management
    2. CMP method calls are faster than EJB
    3. CMP is for small database applications, too

Some Preconceptions about EJB

CMP is about Database Management

The preconception is that EJB is about distributed objects. This preconception has an element of truth, but is no longer complete accurate. EJB was originally designed as a distributed object specification; database management was an afterthought.

With EJB 2.0 and especially with the new local interfaces, database managment is central to EJB and distributed objects can be thought of as an afterthought. With the new spec, it's perfectly reasonable to think of EJB as a JDBC replacement with the option to provide remote interfaces if the site grows large enough.

CMP method calls are faster than EJB

Calls through the new local interfaces are now fast. Method arguments are passed by reference and the request never goes across a slow protocol like RMI or CORBA/IIOP. The local interface calls are slower than regular message calls because EJB method calls support database transactions. Because the EJB transaction support enables aggressive database caching, the performance of an application will likely be better than one using raw JDBC calls.

CMP is for small database applications, too

With the addition of local interfaces, EJB is now suitable for all web applications from simple weblogs to huge financial applications. The preconception that EJB is for large systems is due in part to application server vendor marketing, in part due to journalists, and in part due to the initial distributed object focus of EJB.

Vendors and journalists are impressed with large configurations. The mega-applications are impressive: amazon.com, eBay and Schwab's web trading are a big deal. The vast majority of sites are much smaller and don't have the same requirements as the mega-sites. In particular, the most sites have no need for distributed objects. Many sites, in fact, only need a single web server.

Since many projects fail because of overdesign, good engineers design small, elegant solutions. Since most web applications don't need distributed objects, a good engineer will avoid adding the extra complexity just because journalist writes a breathless article describing a huge distributed object solution.


User's Guide
User's Guide
CMP Relations Catalog
Copyright © 1998-2006 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.