Node.js - Introduction
It is an java script technology,which we will use server side programming.
Java script majorly executed on client side.Java script based framework and provide run time environment.
Node.js is open source, completely free, and used by thousands of developers around the world and customize as per requirement.
Node js is a library and provide run time environment.
Node js is performing operations/things in server side. (it is a server side platform).
What Is Node JS ?
Node.js was developed by Ryan Dahl in 2009.
Features of Node.js
Asynchronous and Event Driven :
All APIs of Node.js library are asynchronous.
Node.js based server never waits for an API to return data.
The server moves to the next API after calling it and a notification mechanism of Events of Node.js
helps the server to get a response from the previous API call.
Very Fast :
Highly Scalable :
Node.js uses a single threaded model with event looping.
Event mechanism helps the server to respond in a non-blocking way and makes the server highly scalable as opposed to traditional servers which create limited threads to handle requests.
Single Threaded :
Node.js uses a single threaded program and the same program can provide service to a much larger number of requests than traditional servers like Apache HTTP Server.
No Buffering :
Node.js applications never buffer any data. These applications simply output the data in chunks.
When to use node js ?
- For streaming or event based applications
- Chat application
- Game servers
- Streaming servers
- Single Page Applications
- JSON APIs based Applications
- Data Intensive Real-time Applications (DIRT)
- I/O bound Applications
Where Not to Use Node.js?
It is not advisable to use Node.js for CPU intensive applications.