What is Node?

What is Node?

Node is a new platform for creating web applications, that offers some significant advantages over more traditional environments.

Some background

To understand what makes Node so powerful, we need a little background on how the web works. Website and web apps are hosted on servers that are connected to the internet. Each time you visit a website, your browser sends a request to the server. The server will process that request, then send back the data your browser needs to display the page you want to look at. Until now, most servers had to process things in a sequential basis. Broadly speaking, this means that some parts of code can get blocked from running until the previous section of code has finished.

Node can multitask

Node brings a number of benefits but the main one is it’s ability to multitask. Node is non-blocking, allowing it to run code asynchronously. Where other servers would have to wait patiently for one bit of code to finish, Node can crack on running the rest of the code. The end result is software that can be run far more efficiently, delivering far more power for far less resources.

The non-blocking nature of Node does have drawbacks. It certainly adds some fun considerations for programmers, and in some specific computational tasks that Node will not perform well at, but on balance, Nodes ability to run code asynchronously has made it the default choice for many projects.

Node is real time

In most web applications, the conversation between the web browser and the server is quite one sided. The browser has to initiate things with a request to the server, then the server can send an appropriate response. But what if the server wants to initiate the conversation? Perhaps it has updated information for the browser. Node allows real time communications between the browser and the server in both directions.

One language to rule them all

It is not uncommon to find web applications that utilise a range of programming languages to perform different tasks. One of the most common languages known by developers is JavaScript, as it is used to add dynamic behaviour and animations on a web page.

Node was essentially created by taking the JavaScript engine from Google Chrome, and adapting it to run on a server. This meant that you could use JavaScript to write both server side and browser code. With the addition of MongoDB which is a JavaScript based database, developers are now in a position to use JavaScript and its associated data formats across entire projects, greatly reducing he need to switch languages as they worked on different parts of their system and the risk that comes with translating data types.

In short

Node is a very powerful and flexible server platform that has some distinct advantages over many common alternatives. While there are some situations where Node is not going to be the best choice, they are fairly specific scenarios. Node is quickly becoming the go to platform for creating web apps, and for very good reason.