What is Node.js
Why use Node.js
In today’s world, most of the applications are based on a stateless request-response framework. So in this situation, it is developer’s responsibilities to make sure correct code is placed to ensure the state of web session was maintained. And here comes the main advantage of Node.js. With Node.js, you as a developer can build application that work in real-time and have a 2-way communication. The state is also maintained.
When to use Node.js
Node.js is perfect for below scenarios where it is streaming or event based real-time
- Communication applications
- Real-Time Apps
- Data-Intensive Apps (With proper caution)
- Scalable Backend solution
- Non-Blocking Asynchronous Thread
- Streaming server – Here client requests multimedia to be streamed from different servers.
- Collaborative environment – Here multiple clients want to work collaboratively on the same content.
When to not use Node.js
For CPU intensive operations, Node.js should not be used. CPU intensive operations like video processing, image processing, machine learning etc. The reason behind is that Node.js has only one thread that handles requests. So if one thread is taking too long to complete the request, then other requests will wait until the previous request is done.
- Asynchronous event-driven IO helps concurrent request handling – This is the most important feature of Node.js. This feature makes sure that if a request is received by Node for some Input/Output operation, it will execute the operation in the background and continue with processing other requests.
- Concurrent request handling – Node.js can handle concurrent connections with a very minimal overhead on the single process.
- Awesome developer community – The community is very active. So getting help from the community is very easy. Also due to the high active community, framework is always up-to-date with the latest web technology.
With that let’s move to the next page where I will talking about “How to install Node.js“