Node Js Tutorial
- Node JS Introduction
- Node JS Installation
- Node JS Architecture
- Node JS Modules
- Node Js: FILE SYSTEM MODULES
- EVENTS IN NODE JS
- Node JS and Mysql
- Create Application in Node JS
- Global Object in Node JS
- Creating and loading Node Module
- EXTEND EVENT EMITTER
Questions & Answers
Node JS Architecture
In Web Applications-:
In Forefront user interacts only with the Client of the web Application, the rest is handled by “Server”. Like basic infrastructure is-:
– Node JS uses “Single Threaded Event Loop” architecture to handle multiple concurrent clients at same time.
Now look at actual NodeJS server itself everything centers are around the concept of event loop and event loop event queue an operation completed and fire requests threaded pool and then you will do actual computation or file system interaction all of this interconnects in a nice seamless loop the great thing again with nodejs is that it’s not new technology’s been around for almost a decade it’s very well tried adds many of the largest websites out there are runny, so let’s now dig into each of the parts of the node.js architecture so let’s talk about some requests so the way that the request works is that you have your framework such as angular on the client and that will then send a request to the web server there’s many ways that those requests can happen through web workers through forms and through other interactions but at some point a request is sent to the server and so these requests can be for data they can be for deleting data they can be for updating data they can be interacting with services as mentioned before but the goal is to have some kind of request now once that request actually hits the server and then we start actually getting into the queuing and thread process that centers around the event loop and this is where know Jeff’s really excels because it’s able to use that single threaded and model to be able to manage from just even a few requests to tens of millions of requests so it receives the actual requests and starts the event here and this is where single threading process starts it’s by queuing everything up appropriately and then it maintains the thread within pool so you have the curing process as one action and then you have a threaded pool which manages those time threads as well and then we have an event loop which you know goes through, receives and processes those requests. External components such as database, file system and computation it could be cloud system it could be an API file system.
Now look at Work Flow process through following diagram-:
- Handling concurrent client requests is fast and easy.
- There is no need of creating multiple threads because of Event Loop;
- Node.js utilizes less resources and memory.