DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more
  1. DZone
  2. Coding
  3. JavaScript
  4. The Speed Race Is On: Vert.x and Node.js

The Speed Race Is On: Vert.x and Node.js

Chad Lung user avatar by
Chad Lung
·
May. 29, 12 · Interview
Like (0)
Save
Tweet
Share
23.06K Views

Join the DZone community and get the full member experience.

Join For Free

Vert.x and Node.js are similar in some ways, and different in others. One such difference is that Node.js only allows you to write code in JavaScript whereas Vert.x allows you to code in Java, Groovy, JavaScript, Ruby and eventually as the Vert.x team expands support for the following is planned: Clojure, Scala and Python. So what happens if you could have as good or better performance (a very simple benchmark – check out the comments though!) than Node.js and you can write your code in your preferred language which may or may not be JavaScript?

One of the benefits of Vert.x is that it uses the JVM which over the years has been fine tuned by highly skilled people. Of course one of the arguments of using the JVM is that people might not trust the current caretaker of Java that is Oracle. With Node.js though you are currently dependent on Google’s V8 (and you might make the argument for Joyent as well). Either way there is corporate backing to V8 and Java so for each project there is really no way around that.

Ideally, the ability to code in your preferred language (or mix and match) and use mature libraries for the JVM is a big win for some developers. Node.js however is maturing quickly and has several solid libraries out there now (Express, Socket.io and Mongoose are three that immediately come to my mind and there are more).

Something that struck me right away is that using more cores on your server is dead simple with Vert.x, a command like this is what you can use:

vertx run server.js -instances 4

Have a look at this post from Tim Fox on the Vert.x Google Group regarding the concurrency model. Now, check out my article on building a clustered ATOM server with Node.js. Also, clustering on Node.js is currently in the experimental stage as noted by their docs.

Tim Fox mentions in another thread: “Also vert.x scales far more easily than node.js. For example if I create a simple webserver it will scale across available cores just by specifying the -instances command line param (see the front page of the web site). With node.js you have to manually start N instances, and then implement glue code (cluster module) to farm out requests between the instances.”

Here is another interesting tidbit from Tim: “As mentioned above, one advantage of vert.x over node.js is it doesn’t force you to run everything on an event loop, so you can more easily use legacy blocking APIs (e.g. JDBC). You can’t do this with node afaik.”

Working with both Vert.x and Node.js I’ve found building a project to be quicker to build in Node.js along with a little easier debugging. With Vert.x there are more pieces you have to mix in, see my post here. As time moves on though things will get easier. Right now you’ll find that there are more articles and books out there for Node.js.

This is just the tip of the iceberg of course. Each project is relatively young yet gaining a lot of attention now. Regardless of which one you choose the great thing is these kinds of projects are pushing the envelope now of how new apps can be built in the future. As developers, we win either way. The thing to keep in mind is to use the right tool for the job. I like both of these projects and will be closely following them.

 

 

 

Node.js Vert.x

Published at DZone with permission of Chad Lung, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 10 Easy Steps To Start Using Git and GitHub
  • How To Build an Effective CI/CD Pipeline
  • Using GPT-3 in Our Applications
  • Cucumber.js Tutorial With Examples For Selenium JavaScript

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: