Why is Jboss "better" than Tomcat? [closed]
Asked Answered
M

7

43

I'm currently starting a new app development. The app architect insists we use JBoss5 because its "better". Do anyone has a wider definition of "better" (if its the case)?

I have experience using Tomcat5 and 6 in large scale applications with big user loads and it handles pretty well (IMHO). Both would be running over a RedHat6 in identical hardware conditions (in case the implementation matters).

Thanks in advance

Myxomatosis answered 9/9, 2010 at 0:7 Comment(9)
@Chepech: this is subjective, but I assume his saying is more like "because it's more complicated, hence it must be better" :) Can't give you any proof on this topic, I am already overwhelmed by all sorts of Java application servers... I wish there were only one single universial Java App Server...Reflect
yea, I am using JBoss right now, and when they say better, they are not talking about the quality of documentation... sighPoon
@Michael I hope this will NEVER happen. Imagine if we had all to use WebShi^H^H^HSphere...Pahang
@Pascal - Stop it, you're scaring me. 8) You're gonna make me run to Python.Enterogastrone
@Pascal Thivent: I don't what to run into any war against anything, but the C# develpoers seem okay with Visual Studio. All software has bugs, I reckon it is better if we can deal with only the bugs from one source :) (I am helping people with defects day-to-day, errr...)Reflect
@Michael I didn't mean to start a war either (and I really didn't mean to offend you, I didn't notice you were an IBMer) but I'm happy to have choice, even if this makes things more complicated (and the quality of the runtime environment offered by Microsoft is not something that is going to convince me a closed universal environment is the best thing we can get).Pahang
Did you try asking the person who said "it's better" what he/she meant? I don't get questions like this, why people are afraid to ask others questions and learn and instead come to SO to ask. Perhaps the person had a well-thought out response, perhaps they are an idiot, it's impossible for us to tell.Goosefish
@matt: I actually did, this is what he answered: "Well, Tomcat is good for POCs and small stuff, but JBoss is meant for bigger things"...which is kind of unsatisfying.Myxomatosis
@Chepech, that's not even an answer! It's a circular answer, like if "I asked you why the sky is blue?" and you told me "because it's blue". This might just be my opinion but people that are unable to articular the why of their statements tend to not really be worthy of much attention (or responsibility).Goosefish
A
68

To say that any tool or framework is just 'better' is ridiculous. It always depends on the situation, architecture, etc. You don't necessarily want to use a hammer to drive a screw.

I wrote JBoss in Action, so I obviously like the JBoss technology, but I'll be the first to say that JBoss can be overkill in many situations. For example, for the last two sites I've developed, it made more sense to build with Grails and deploy on a standalone Tomcat instance.

Its a bit unfair to say that all you get when using JBoss is EJB and JMS. JBoss offers many services and features, including:

  • Servlet/JSP container
  • JNDI
  • EJB
  • JTA
  • clustering
  • caching
  • JMS
  • Datasource / Resource management
  • JMX integration
  • OSGi support
  • web services
  • portals
  • Web Beans (Seam)
  • Some administrative consoles
  • an IoC container
  • etc.

The thing that attracts many architects to JBoss is its flexibility. It uses a plugin architecture that allows you to add and remove services. As other have said, in uses Tomcat as its Servlet container, so you can literally whittle JBoss down to where it is practically just a Tomcat server. What is the benefit of doing this? Future proofing if you think that you're going to utilize other features of JBoss.

These services in JBoss come pre-integrated and strive to provide a consistent deployment model that minimizes your effort in writing application logic or configuration to integrate them yourself. That being said, other frameworks like Spring also do a great job of supporting a uniform ways of integrating many popular libraries and frameworks. But since they focus on integrating 3rd party libraries, the interoperability between services is up to you. Because JBoss is building the services and the integration platform, they spend time developing (and providing support) for interoperability.

Some questions to ask when making a choice are:

  • Are you going to use standard JavaEE architectural components like EJB?
    • BTW, EJB can be run in standalone Tomcat using the JBoss embedded container, so if EJB is all you're using, then you still don't have to use JBoss
  • Are you going to utilize Web Services, Portals, JMS?
  • Are you looking into building with Web Beans or Seam?
  • What deployment platforms (Tomcat, JBoss, etc) does your IT, support, and development staff currently use? If you are going to use something new, you will incur additional cost to learn the new platform.
  • If you're selling a product that customers will deploy, what impact will it have on the customers' IT organization.
  • Are you going to need paid support?
    • You can find support for Tomcat through many companies (including Red Hat I believe).
    • You'll need to compare the costs, because I don't think JBoss support is cheap, though I haven't looked up prices lately.
  • Will you need to do any sophisticated clustering?
    • JBoss has some wonderful clustering capabilities, and you'll probably get good clustering support through Red Hat. Though, for full disclosure, I've never done any complex clustering with any other frameworks to be able to compare.
  • Are you going to need advanced transaction management (distributed transactions, 2-phase commits, etc)

Not to sound like a shameless plug, but the first chapter of JBoss in Action is available for free on the Manning website. Though we don't do a direct comparison between JBoss and other applications servers and deployment environments in the chapter, we do talk about the architectural differences a bit, which is relevant to your question.

Antimicrobial answered 9/9, 2010 at 4:7 Comment(6)
Nice answer (and +1 from me). Regarding clustering, could you describe in a few words some obvious advantages of using JBoss vs Tomcat with mod_jk or mod_proxy or even mod_cluster for a Servlet/JSP application? Maybe things like clustering of JNDI tree or of datasource? Anything else obvious?Pahang
This seems like it should be a question by itself, but mod_jk and mod_proxy are mainly used for load balancing, in which the Tomcat instances don't necessarily have to know about each other. I haven't used mod_cluster, so I'd have to research. JBoss offers replicated caches, JNDI clustering, session bean clustering, HTTP session replication, JPA/Hibernate 2nd level cache replication, service singletons (service only runs on one server but can failover), and a few other things.Antimicrobial
Right, these mod_xxx are only for load balancing, which is different. Actually, since Tomcat also supports persistent HTTP sessions, I was wondering what could be good samples of sophisticated clustering features for a webapp (JNDI is one). But this should be indeed a question by itself. Thanks for the answer anyway, it already gave me some good hints.Pahang
+1 from me, too. I didn't mean to slight JBOSS by only mentioning EJB and JMS, Javid. Your (very good) list makes it clear that there's lots more to it. I was just being succinct.Enterogastrone
"To say that any tool or framework is just 'better' is ridiculous." I agree 100% with that statement. That said, when forced to choose between tools, always go with the hammer. There is no problem that can't be solved with a big enough hammer.Georgetta
But sometimes in java, when you use something, you now have a ProblemFactory. If Hibernate is a Big hammer and JDBC is smaller, the smaller hammer should be better if I was forced to choose. Chances are higher to get your app working. You can always move to Hibernate later on if you actually need it.Erotomania
E
37

I'm currently starting a new app development. The app architect insists we use JBoss5 because it's "better". Do anyone has a wider definition of "better" (if its the case)?

Funny, because JBOSS uses Tomcat as its servlet/JSP engine.

Sounds like "better" means "supports EJBs and JMS", because Tomcat out of the box has neither.

But that's not an issue if your application doesn't use EJBs or JMS.

And if you do need them, you can add them to Tomcat with OpenEJB and RabbitMQ or ActiveMQ.

I'd ask your app arch when the last time they wrote something besides Power Point slides or UML documents. The response might surprise you.

Enterogastrone answered 9/9, 2010 at 0:19 Comment(6)
+1 for when the last time they wrote something besides Power Point slides - so so true it's almost as if you are working in my organization :)Foin
Sadly, it's true of too many organizations.Enterogastrone
@duffymo: Dude, I think you nailed it with the PPT comment, you really made my day =). We are not adding EJB or JMS by the way.Myxomatosis
So why not accept the answer? It's a good thing for both of us.Enterogastrone
@duffymo: Sorry man, I have a thing for long, detailed answers, besides Javid Jamae worte a book... you can't compete with that =)Myxomatosis
Sometimes succinct is better. Depends on the book.Enterogastrone
V
15

JBoss is an Application Server while Tomcat is a Servlet container

So JBoss may be better than Tomcat in the sense it contains it, plus other components. That's it.

If you're not going to use those other components, you're wasting resources. If you need those other components then Tomcat is not enough.

It depends, probably your Architect has something else in mind.

I wonder what would he say if you ask him directly?

Vaughnvaught answered 9/9, 2010 at 1:15 Comment(0)
S
6

It's not better, it's just more. JBoss includes Tomcat.

Sailesh answered 9/9, 2010 at 1:18 Comment(0)
P
5

As @duffymo points out, JBoss uses Tomcat for its web container so better makes not much sense if we compare equivalent things (i.e. Tomcat and the web container part of JBoss). And if you are not going to use JTA, EJBs, JMS, JMX, etc, there is no real advantage at using JBoss, especially during development (Tomcat is lighter and starts faster, this is often appreciated by development teams).

There are some cases where you could prefer JBoss for production though (I'm still assuming you're not using EJBs, etc):

  • The production team is trained or used to use JBoss in production, tools (deployment, monitoring, etc) are tailored for JBoss.
  • The company has a support contract for JBoss (although you can also get support for Tomcat).

But I'm not sure this is what the app architect meant. I would try to discuss this choice with the architect, maybe he has a rationale explanation. And if really JBoss has to be used in production, you can always use Tomcat or Jetty during development.

Pahang answered 9/9, 2010 at 1:2 Comment(0)
W
2

If you use JBoss, you can pay Jboss.org for support. But it is not the case with Tomcat.

This is true, however RedHat (who bought out Jboss.org) will require you to change to one of their supported versions of JBoss

Weekly answered 9/9, 2010 at 1:36 Comment(1)
You can get support from SpringSource for their tc ServerPahang
T
1

JBoss is J2EE specification compliant, it supports J2EE specification very well, such as EJB, JTA,JMS, JNDI and etc. Tomcat is only a servlet container, although it also supports a bit J2ee specification. When you want to use J2EE component, you should consider JBoss first.

Forgot a point, JBoss supports JMX very well, especially in version 4.*. I have experienced a project, it doesn't have a web UI, JBoss is used just as a platform and EJB container to integrate all the standalone application on it use MBean.

Tonatonal answered 9/9, 2010 at 1:38 Comment(4)
Servlets and JSPs are both part of the Java EE spec. Tomcat might be a mere servlet container, but it's still a valid subset of the Java EE spec. It's the reference implementation for all servlet/JSP engines. And J2EE is 1998 vintage terminology. They dropped the "2" a long time ago.Enterogastrone
Yes, you are right, but I'm still used to calling it J2ee, because I'm an old man :-)Tonatonal
@Enterogastrone Tomcat is not the RI anymore since Java EE 5, GlassFish is the RI for JSP/Servlet.Pahang
You're a young buck to me, my friend. I have t-shirts older than you.Enterogastrone

© 2022 - 2024 — McMap. All rights reserved.