Five misconceptions on how NodeJS works

Click for: original source

NodeJS was born in 2009 and it has gained massive popularity throughout the years because of one reason. It’s just JavaScript! Well, it’s a JavaScript runtime designed to write server-side applications, but the statement that “It’s just JavaScript” is not 100% true. By Deepal Jayasekara.

JavaScript is single-threaded, and it was not designed to run on the server-side where scalability was a critical requirement. With Google Chrome’s high-performance V8 JavaScript Engine, the super cool asynchronous I/O implementation of libuv, and with a few other spicy additions, Node JS was capable of bringing client-side JavaScript to the server-side enabling writing super-fast web servers in JavaScript that are capable of handling thousands of socket connections at a time.

The article is split into:

  • EventEmitter and the Event Loop are related
  • All callback-accepting functions are asynchronous
  • All CPU-intensive functions are blocking the event loop
  • All asynchronous operations are performed on the thread pool
  • NodeJS should not be used to write CPU-intensive applications

Each topic si well explained. You will also get plenty of charts helping to explain the main points discussed in the article. Nice one!

[Read More]

Tags javascript nodejs programming