Node.js is the JavaScript runtime environment which is based on Google’s V8 Engine i.e. with the help of Node.js we can run the JavaScript outside of the browser.

Node.js is an open source server environment. It allows you to run JavaScript on the server. It runs on various platforms like Windows, Linux, Unix  etc.

It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. It can create, open, read, write, delete, and close files on the server. It can collect form data. It can add, delete and modify data in your database.

Is Node JS frontend or backend?

Node. js is a runtime environment that allows software developers to launch both the front end and back end of web apps using JavaScript. Although JS is basis in all the processes for application assembly, as a back end development environment, Node. js, differs from the front end environment

Before learning Node.JS

You should at least have a middle level of knowledge in Javascript. Learn how objects and functions in Javascript work, without ever using classes. Learn what callbacks are. As a newcomer, it’s hard to get to a point where you are confident enough in your programming abilities.

Why Node.JS?

Web server’s common task can be to open a file on the server and return the content to the client.

How PHP or ASP handles a file request:

  1. Sends the task to the computer’s file system.
  2. Waits while the file system opens and reads the file.
  3. Returns the content to the client.
  4. Ready to handle the next request.

How Node.js handles a file request:

  1. Sends the task to the computer’s file system.
  2. Ready to handle the next request.
  3. When the file system has opened and read the file, the server returns the content to the client.

Node.js runs single-threaded, asynchronously programming, which is memory efficient. Node.js files contain tasks that will be performed on certain events. A typical event is someone trying to approach a port on the server. Node.js files must be started on the server before having any effect. Node.js files have extension “.js”

Who uses node.JS?

  • Netflix
  • NASA
  • PayPal
  • LinkedIn
  • Uber
  • Twitter

Scalability is the core of Node.js is well-suited for micro services architecture, which is really useful for the projects that will scale and grow in the future. Also, it is possible to create a separate micro service for any functionality, and then scale it separately from all other parts.

Disadvantages of Node JS

  • Minimizes performance when controlling heavy Computing tasks.
  • Node.js invites a lot of code changes due to unstable API.
  • Node.js Asynchronous Programming Model makes it difficult to maintain code.

 


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *