-3

I came across this article: Stop Wasting Money On WebLogic, WebSphere, And JBoss Application Servers via a tweet today.

The article starts with

I don’t understand why firms spend millions of dollars on Java application servers like Oracle Weblogic or IBM WebSphere Application Server. I get why firms spend money on Red Hat JBoss -- they want to spend less on application servers. But, why spend anything at all? Apache Tomcat will satisfy the deployment requirements of most Java web applications.

and goes on giving some reasons why:

  • You need an application container that supports EJBs.
  • Optimized application servers optimize hardware
  • Two-phase commit is serious
  • Manageability
  • Clustering supports scalability, performance, and availability

I love Tomcat and have developed on it, so I will be happy if all these are true. However, I don't see much convincing reasons that you don't need any other application server at all.

So, my question is: In what situations you think you need an (so called) advanced server like Weblogic/Websphere/JBoss. Is there a business case for Websphere/Weblogic/JBoss at all, or should Tomcat do almost always?

Is there something essential that Tomcat does not/can not provide?

Nivas
  • 18,126
  • 4
  • 62
  • 76

3 Answers3

4

The article is not really correct.

Glassfish, Resin, Jboss AS, TomEE and a few others are all opensource and free. You don't have to pay a dine to anyone to use them.

The part about EJB is especially nonsense. It's not 2004 anymore! These days EJBs are very simple lightweight pojos. You don't need any heavyweight XML or invasive framework inheritance. They among otherd massively simplify working with JPA and make simple asynchronous methods a breeze.

A big falsehood in "Tomcat in enough", is that actually a bare Tomcat never is enough. Not a single non-trivial application runs only on Tomcat. Even trivial applications have a hard time with that. Instead, people add tons and tons of additional libraries. Typically at least JSF, Spring, Javamail, some JTA impl. and Hibernate. This equals a few dozen jars, of which the user has to make sure they are all working together, and after some time whether they are all still needed.

With a Java EE implementation, you get everything you need in a single package. All dependencies are already worked out for you and it's guaranteed to work together as a whole.

If someone is really concerned about having functionality available, but not using it; there's the Java EE Web Profile. This is a subset of the full Java EE profile that contains the functionality most web applications would use: jsf, cdi, ejb (lite), jpa, jta and javamail.

Web profile implementations can be very small. Resin for instance is 20-something MB, compared to Tomcat's 7 or 8 MB. Yet Resin is a full stack solution, while Tomcat is a bare bones servlet container that as said needs tons of additional libraries. Startup time of Web Profile implementations is mere seconds (Glassfish v3 and JBoss AS 7 start in 2 to 3 seconds).

Mike Braun
  • 3,729
  • 17
  • 15
  • To be fair, the article does state "EJB3 fixed the original EJB debacle, but why bother? Use Spring, and you don’t need an EJB-compliant container." – Ali Aug 27 '11 at 19:04
  • 1
    Yes, but that's just silly. You can easily counter with "Why bother with Spring? Use EJB and you don't need a Spring container" – Mike Braun Aug 27 '11 at 19:34
  • It really becomes a point of preference, but I believe the statement was meant to imply that there is a viable alternative out there that does not require any platform dependency. I realize from our conversation above that EJB 3's aren't app-server dependent any more, but Spring will run on a simple servlet engine. – Ali Aug 27 '11 at 19:38
  • 2
    EJB also runs on a "simple servlet engine" (as does CDI btw). The point is that when you add Spring to a simple servlet engine, it's no longer a simple servlet engine. – Mike Braun Aug 27 '11 at 19:51
  • >`there is a viable alternative out there that does not require any platform dependency` - EJB containers run on any JVM, which run on any OS. Code that uses EJB is portable to many EJB containers, code that uses Spring can only work in a single Spring container: the one made by SpringSource. – Arjan Tijms Aug 28 '11 at 08:46
3

Apart from all the useful information that was already given, I'd like to say that a lot of customers are willing to pay extra cash to the vendors that provide additional support. Have a look at the IBM Websphere support. I guess it could be very useful for maintaining critical business applications.

jFrenetic
  • 5,384
  • 5
  • 42
  • 67
  • seconded.. in my experience, i see very few clients who are willing to forego full vendor support that isnt offered as comprehensively for TC. That said, some are willing to consider SpringSource's TC Server as a possible option (Springs tweaked tomcat plus they offer commercial support packages) – rhinds Aug 27 '11 at 18:00
  • 1
    I don't know. Personally I think support packages are a bit of a scam. I'd almost go so far as to suggest that some vendors intentionally leave their software difficult to configure/poorly documented so that they can generate revenue through selling support contracts. If your software is robust and well-documented then there's no reason why anyone should need to pay for an ongoing support package. But then that would kill the revenue stream for a lot of these companies. – aroth Aug 28 '11 at 03:05
  • @aroth, I partially agree with you. I was talking from customer perspective. We once worked for a German company, which had some sort of premium partnership with IBM. In this case it was pretty obvious why they chose IBM Websphere. – jFrenetic Aug 28 '11 at 17:04
2

Depends on what your application needs. Tomcat is mostly just a servlet container, while JBoss, Websphere, and the others provide full Java EE support (usually plus additional platform-specific features above and beyond the Java EE spec).

For many applications, a servlet container is sufficient. Especially since you can get a lot of Java EE-like features by just bundling the appropriate libraries as part of your webapp. But sometimes you need this-or-that feature that is only readily available on one of the full-scale application servers.

That said, using a full Java EE server when all you really need is a servlet container does strike me as a fairly foolish thing to do. As a general rule I always start with Tomcat, and only switch to something like JBoss once I've identified a need for something that Tomcat can't provide (doesn't happen often).

It's really trivial to take a webapp that runs on Tomcat and make it run on JBoss, so there's no reason to jump straight to the more complex platform and no real penalty if you decide to do so later on in the game.

Regarding the specific points raised in the blog article:

You need an application container that supports EJBs

He's right, you don't need this. There are popular frameworks like Spring which provide the same sort of functionality as EJBs. You can do just as well with one as with another, and it's generally not the case that you will use both at the same time.

Optimized application servers optimize hardware

No comment. Personally I'm of the opinion that unless your webapp is doing heavy multimedia processing or similar tasks then modern hardware has gotten to the point that it is more than fast enough to run whatever your app may be, even without any special optimization. That's why virtualization is such a big deal. A single server is now way too powerful to dedicate just to a single site, so we carve it up into several virtual servers each running their own site because otherwise all that computing power just goes to waste.

Two-phase commit is serious

Again I don't disagree with the blog post. Two-phase commit is not serious, unless you happen to need it. And I've never once needed it. A database with optimistic transactions and rollback has been sufficient for every project I've ever worked on.

Manageability

In my experience as a developer, JBoss is far less "manageable" than Tomcat. It is just ridiculously difficult to configure. Granted that's not the same type of manageability the article is referring to, but it's still worth noting. Other than that, Java EE containers will generally have far more built-in features surrounding server management, but there are also plenty of third-party tools that you can use to get similar features out of Tomcat (or any other flavor of server).

Clustering supports scalability, performance, and availability

Tomcat supports clustering, and is no less scalable than the other platforms. In fact, JBoss runs on top of Tomcat, so obviously there is nothing about Tomcat that inherently prevents it from scaling or makes it unsuitable for use as an enterprise-level platform.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
aroth
  • 54,026
  • 20
  • 135
  • 176
  • _something that Tomcat can't provide:_ This is actually what I am looking for. any specific examples you remember? – Nivas Aug 27 '11 at 14:44
  • 1
    The one thing I've encountered in the past is support for cluster-wide singleton objects (i.e. a class where only one instance exists in the entire cluster, that every other cluster-member is able to refer to/access). Tomcat doesn't have this. JBoss does. – aroth Aug 27 '11 at 15:02
  • 2
    Tomcat itself only supports Servlet and JSP. So there are thousands of things Tomcat doesn't provide. Yes, you add libraries but then you can just as well say you're running on the bare JVM, since afterall Tomcat is also just functionality added to the JVM. – Mike Braun Aug 27 '11 at 19:05
  • 2
    >`A database with optimistic transactions` - I guess you mean resource local transactions in combination with optimistic locks. Two-phase commit is very handy when multiple transactional resources are involved in a single tx. This can be two databases, but also a database and a distributed cache, or a db, cache and jms message. In all cases, the system makes sure not just multiple tables are all updated or not, but multiple resources are all updated or not. Most if not any XA transactions automatically optimize to not use 2PC when only 1 transactional resource is present in the TX. – Arjan Tijms Aug 27 '11 at 22:04