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