O'Reilly logo

Hands-On Microservices with Node.js by Diogo Resende

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Asynchronous I/O

The main purpose and the initial idea behind Node.js was to be able to handle asynchronous I/O effectively. To achieve that goal, Node.js has a very good toolkit. It's built around libuv, which empowers the JavaScript language to do asynchronous I/O.

This means that it's kind of a silver bullet in this field. As long as your application is slim, not very CPU intensive, and is able to handle I/O efficiently, Node.js is the right tool for you.

Although it's true that your code runs in a single thread, as soon as your code needs to open a file or make an HTTP request, it uses other threads to do so. So, to really take advantage of the Node.js architecture, you should use it for writing code that actually needs the core API. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required