Choosing a J2EE/EJB AppServer
You thought you had made the tough decision - you picked the Java/EJB/Unix platform over the Microsoft platform for your web development. Now comes the easy part - getting a server. Right? Wrong, welcome to the world of choice. With Microsoft there was basically one choice: IIS/MTS. With the Java platform, you have at least 25 viable J2EE/EJB servers. This article explores strategies for choosing the right server for your application. We'll go though several different questions that will help focus your decision down to a few servers. Several vendors will be mentioned by name but most will not. For a complete list of vendors and prices consult the excellent list of servers provided by
Flashline.
To EJB or not to be?
Using Java on the server does not require you to use EJBs. Java Server Pages (JSP) alone can be used effectively for simple sites. You will loose the load-balancing, transaction and database support that EJBs give you but will have a much less complicated (and expensive) setup. If you were starting with a crack team of Java developers, I would consider avoiding EJB until better Open Source EJB Servers are available (see next section).
Ante Up
The major issue for most developers is software budget. If you expect the software to cost nothing you are in for a surprise.
Linux may be free but an EJB server isn't. (Actually, that's not strictly true. There are several open source server: JBoss, JonAS, EnHydra and OpenEJB. But none is as ready for prime time as Apache. If you go with one of them, you will pay with your time.)
For Java Server Pages (JSP) only,
Apache/Tomcat is a viable Open Source (read "free") choice. If you have a limited server budget, consider using JSP without EJBs. Using industry leading commercial servers will end up costing at least 10k per CPU.
Performance, Scalability and Reliability
How many clients do you expect to have accessing your system at one time? How large a dataset will your application support? Just because EJB applications can be put together easily doesn’t mean you can get a high-performance system easily. In fact, EJB performance out of the box tends to be horrible. This is mainly because simplistic implementations of the EJB specification will make one RMI and two database calls for each bean call. With this overhead you will be lucky to get 100 calls a second out of your high-end server.
The ability to tune for performance is the main thing you get with a high-end EJB server. It still doesn’t come easy though. For example,
BEA will perform poorly unless you turn on bean caching and reduce database transactions. Tuning an EJB server, while not as difficult as tuning a database server, is still a challenge.
The tuning doesn’t stop with a single server. Any large, highly available site will require some form of server clustering, in which multiple server CPUs are made to work as one unit. BEA Weblogic is the leading provider here. A good server will also allow multiple Java virtual machine per CPU. The
Gemstone AppServer does an excellent job of load balancing across multiple VMs. Other solutions, like Weblogic, require a distinct IP address for each VM, even on the same machine.
Database Integration
Sun really messed up database integration in the first versions of the EJB specification. The upcoming EJB 2.0 specification (already implemented partially in BEA Weblogic) finally starts to get it right. Yet some application servers, like Gemstone, have not yet implemented the minimal CMP support described in the 1.1 specification. Other servers may have implementations of lower quality.
But even if you have a good CMP implementation, can you use it? Most applications are tied to legacy databases that will be difficult to map into beans. If you can’t take advantage CMP because of legacy integration issues, EJB may be of less value to you.
Do you "really" know EJB
The simplicity of development of EJBs can be deceptive. Yes, you can easily get persistence and transactions, but at what cost? We have already seen how poorly EJB servers can perform without tuning. Poor design can make things worse. There are many pitfalls to avoid. Session beans must interface efficiently with entity beans. Stateless beans must be used as much as possible. Stateful beans must be written at the correct level of granularity. A simple programming model can get very complicated.
Tools Anyone
How important are integrated visual tools to you team? Do you need a tight integration between code editors, server and debuggers? If so, go with the big boys here. BEA Weblogic teams up with tool provider (and subsidary)
WebGain. IBM provides VisualAge for Websphere. If you have Windows-centric developers you will need to get one of these servers with good tools integration. Unix-centric developers probably will expect (and use) simpler tools.
Forget it, just tell me what server to get!
Had enough? Evaluating servers can drive you crazy. There's much to be said for just getting the market leader. Nobody ever gets fired for buying IBM, right? Well maybe, IBM Websphere is a popular product but the overall leader is BEAWeblogic. Both vendors have good products. BEA tends to keep up with the technology better. Also, you will have the easiest time finding people with BEA experience. If I had to make a decision with lowest risk and had the bucks, I’d go with BEA. It will scale as good as any, has as great developer community.
Keeps you ears to the ground
Finally, One thing is for certain, by the time you read this the application server marketplace will have changed. New specifications and new releases come at a fast pace. Last years performance leader could be next years performance dog. Here is a annotated list of some resources to help understand what’s here now and what to expect in the future. Good Luck.
Great Sites for EJB Information
Flashline App Server Matrix maintains a great list of servers and prices.
Information from Sun, the creators of the EJB Specification, http://java.sun.com/products/ejb/.
The Sun EJB-Interest Archives have more information than you can possible want about the evolving EJB standard.
TheServerSide is a great resource for Application Servers. Be sure to check out the discussions.
EJBInfo has less traffic but some great technical information.
App-Serv Central has a few articles but doesn’t seem to be updated anymore.
IBM has great information; much of it is applicable to any application server.
IBM DeveloperWorks
IBM Websphere Developer
Great individual articles
Do you really need Enterprise JavaBeans?
Here is a great article on selecting an application server vendor.
Here’s a good introduction to EJB 2.0 from
javaworld.
Clustering is key to high performance: OnJava - EJB Clustering.
Open Source J2EE/EJB
Apache / Tomcat JSP
JBoss
Java™ Open Application Server
OpenEJB