On Fri, Aug 08, 2014 at 04:45:44PM -0700, NodeJS list wrote:
> Hi All,
> Need to build the web server for the new project and don't know whether we
> should use "Node.js+Express" or Tomcat for our UI Web Service on
> server-side. Would like to know the pros/cons between these two.
[...]
I'm just learning NodeJS myself, but I've used Tomcat to host web services
in many previous projects, and I'm very comfortable with Javascript.
What I like best about Tomcat is the deployment story. You build a .war
file and you can deploy it repeatably very easily. If you build your app
properly, you can even deploy a new version without restarting Tomcat
(though I've seen entirely too many apps where that didn't work because the
app would not shut down properly). As I've been lurking I've read about
several approaches to packaging up and deploying apps, but there isn't one
that's considered the "standard" approach and each has its pros and cons.
The biggest con for a Tomcat approach is that you're living in the Java
world. The Java maven ecosystem has comparable functionality to the
packages available through npm, but a whole lot of that ecosystem (I'm
looking at you, Spring) exists to solve problems unique to being forced to
use Java. You can avoid a fair amount of this by using a different JVM
language (e.g. JRuby) and still take advantage of the deployment story, of
course, and the JVM is an excellent execution platform.
The greatest advantage to NodeJS is that you get to work in Javascript,
which is quite a bit nicer (and more expressive) than Java. There is much
to be said for npm and the Node ecosystem. It's also good from a career
perspective to have experience with a cutting edge platform; a solid NodeJS
developer is harder to find than a solid Java/Spring/whatever developer,
and thus generally commands greater compensation.
Honestly, my ideal platform would be a JVM (Rhino-based?) implementation of
NodeJS and npm with a simple (maven-based?) way to package it into a .war
deployable in Tomcat. I don't have any reason to believe that anyone is
pursuing that approach, but it's a nice best-of-all-worlds pipe dream.
> Best Regards, Karen
--Greg