I was looking for a quick comparison of JavaEE and Node.js and came across a blog from StrongLoop that I thought did a good job of a quick comparison including an example for both.
In their post, they showed how to create a REST based web service using Java EE. This service returned a list of beers from the fantastic Pabst Brewing Company. Then created the same application using StrongLoop LoopBack and Node. With very little code in Node, they created a REST web service that returns the name and description of our beers. In addition, the LoopBack API also provides default actions for the entire CRUD process.
The table below shows some of the comparisons discussed in the blog:
Feature
|
Java EE
|
Node.js
|
Great IDE support
|
Yes, multiple choices including Eclipse, Sublime and Idea
|
Yes, multiple choices including Visual Studio, Eclipse, Sublime
|
Dependency management
|
Maven
|
NPM
|
Enterprise ready
|
Yes, in use today
|
Yes, in use today
|
Large ecosystem of libraries
|
Yes
|
Yes
|
Requires JVM
|
Yes
|
No
|
Common frameworks
|
Spring, JEE
|
Express
|
Database support
|
Yes
|
Yes
|
ORM frameworks
|
Yes
|
Yes
|
Testing Frameworks
|
Yes
|
Yes
|
References:
https://strongloop.com/strongblog/node-js-java-getting-started/
http://blog.shinetech.com/2013/10/22/performance-comparison-between-node-js-and-java-ee/
http://www.infoworld.com/article/2883328/java/java-vs-nodejs-an-epic-battle-for-developer-mindshare.html