Sunday, 8 July 2018

Node History

  Node is a programming language or a framework. What is node exactly?

Node is a runtime environment that uses chrome V8 JS engine for executing javascript code outside the browser.

Story of Node

All web browser is having a javascript engine that will compile javascript code into Machine code and the only possible way to execute javascript was inside a browser, So most of the functionalities like reading a file, Writing to a file was not possible
So the creator of Node.js (Ryan Dahl) create a runtime environment that will help us to run JS code outside the browser and he uses Chrome V8 engine.

Why V8 engine?

V8 engine is the fastest javascript engine for executing javascript code, So Ryan Dahl took V8 engine and embed it with C++ program and named it as Node.js.

Image result for v8 javascript engine

How Node Works?

Node provides asynchronous communication, A single thread is used to accept the request. So it will provide non-blocking communication between clients

Asynchronous communication uses a single thread to handle all request. It won't wait for the current process to complete, until the completion of current process it will handle another request.Where's in synchronous communication individual thread is allocated to handle request.Each request will be handled by separate thread.


No comments:

Post a Comment