I like node, I think it does some things very well, and Vert.x clearly takes inspiration from Node.js in the style of the asynchronous APIs.
But node doesn’t do everything well. I’ve highlighted a few areas here:
- Event loops. Event loops are great for ‘event-loopy’ type stuff. I.e. actions that don’t take very long. If your app has that kind of behaviour you can really benefit. However not all actions are like that, e.g. long running computations – doing stuff like that on an event loop is plain stupid (remember the Node.js ‘Fibonacci’ discussions?). Also many legacy libraries have blocking APIs – you don’t want to block an event loop. Unlike Node.js Vert.x doesn’t make you do *everything* on an event loop. You can choose instead to run long running tasks or blocking calls using a thread pool if that’s more appropriate.
- Single threaded-ness. A node.js instance is single threaded. That means it can use at most one core on your server. In order to scale over your server cores you need to spin up many instances and activate another component which farms requests between them using slow interprocess communication. Vert.x scales across your cores *automatically*. You just write your server, no need to write any more glue. It just works. And it uses intraprocess communication so many objects can be shared *without copying*. I.e. it’s faster
- Polyglot. Node.js is JavaScript only. That’s fine if you like JS (and I do), but not everyone does. Vert.x lets you code your server side components in JS, Groovy, Ruby or Java (Scala and Clojure on TODO list)
- Other goodies. Vert.x comes with many goodies including a distributed event bus (which goes right into client side JavaScript), SockJS support, a persistor and others, seamlessly integrated out of the box. Yes you can do this with node.js by manually cobbling together many projects. But vert.x does this hard work for you.
Don’t forget the truly massive back catalog of Java libraries that can be used in Vert.x, since it’s JVM-based. Node is terrific (it really is), but it will take years for the libraries available for Node (implemented in JavaScript, or existing C libraries bridged into the environment) come anywhere near the JVM-based set. This isn’t a negative for Node, but it is a positive for Vert.x.
Vert.X seems pretty exciting – but some of us need a few things that NodeJS does not bring to the table:
- SNMP (UDP) Support
- ICMP Support
- SPARC Solaris Support (I heard Vert.X will run, but did not read it in the Install docs)
- Transparent usage of the Java Crypto Libraries (use-case: SPARC T and SNMPv3)
These things would make VertX superior NodeJS from a Managed Service Provider perspective.
Any thoughts on these?
No Python? Why?