Node.js Tutorial

Welcome to Node.js Tutorial – We shall learn Node.js basics and advanced concepts to program and build server side applications and networking applications.

Node.js Tutorial

Node.js Tutorial Index

Following is the list of tutorials that are well explained with simplified examples to learn Node.js easily.

An introduction to Node.js

Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. The two features that make Node.js stand-out are :

  1. Event-driven
  2. Non-blocking I/O model

To appreciate the features of Node.js and how it revolutionized the server side applications in terms of resource usage and event handling, we might need to take a sneak peak into the traditional model of web servers. And know how Node.js fill the performance voids.

Let us take an analogy of a restaurant with customers where restaurant is a web server and customers are the web clients. Web clients are the browsers or applications that request web server for some data or a task to be done.

In a traditional restaurant (web server), when a customer(web-client) walks in, server takes the order (request), then server waits for the response to be prepared by chef (file system/database). Consider that the restaurant (your web service) has become famous and number of customers coming to the restaurant is increasing day by day. But if you observe, the server is serving one customer at a time. While the chef is preparing the response, the server is being idle, instead of taking requests from other customers. Node.js fills this gap with its event-driven framework. That is after taking a request, the server informs the chef to callback it when the response is ready. Mean while, instead of being idle during this time, server takes requests from other customers and gives it to the database or file system to prepare the response. When a response for a customer is ready, an event is generated to let the server know that the response is ready. Then the server serves the response to the customer.

Programming Node.js Applications

Node.js is a platform built on JavaScript engine. Node.js applications could be developed using JavaScripting. And this is  also one of the important factor for Node.js to become popular as there is a wide community of JavaScript developers out there. They adopted Node.js, industry adopted Node.js quite easily.