SlideShare uma empresa Scribd logo
1 de 8
 A JavaScript runtime environment running
Google Chrome’s V8 engine
 a.k.a. a server-side solution for JS
 Compiles JS, making it really fast
 Runs over the command line
 Designed for high concurrency
 Without threads or new processes
 Never blocks, not even for I/O
 Uses the CommonJS framework
 Making it a little closer to a real OO language
 Instead of threads Node uses an event loop
with a stack
 Alleviates overhead of context switching
Threads Asynchronous Event-driven
Lock application / request with
listener-workers threads
only one thread, which
repeatedly fetches an event
Using incoming-request model Using queue and then processes
it
multithreaded server might
block the request which might
involve multiple events
manually saves state and then
goes on to process the next
event
Using context switching no contention and no context
switches
Using multithreading
environments where listener
and workers threads are used
frequently to take an incoming-
request lock
Using asynchronous I/O
facilities (callbacks, not
poll/select or O_NONBLOCK)
environments
 Request for “index.html” comes in
 Stack unwinds and ev_loop goes to sleep
 File loads from disk and is sent to the client
 Servers do nothing but I/O
 Scripts waiting on I/O requests degrades
performance
 To avoid blocking, Node makes use of the
event driven nature of JS by attaching
callbacks to I/O requests
 Scripts waiting on I/O waste no space
because they get popped off the stack when
their non-I/O related code finishes executing
 Use of JS on both the client and server-side
should remove need to “context switch”
 Client-side JS makes heavy use of the DOM, no
access to files/databases
 Server-side JS deals mostly in files/databases, no
DOM
 JSDom project for Node works for simple tasks, but
not much else
1. It's fast
2. It can handle tons of concurrent requests
3. It's written in JavaScript (which means you can
use the same code server side and client side)
Platform Number of request per
second
PHP ( via Apache) 3187,27
Static ( via Apache ) 2966,51
Node.js 5569,30

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
RESTful API In Node Js using Express
RESTful API In Node Js using Express RESTful API In Node Js using Express
RESTful API In Node Js using Express
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
 
react redux.pdf
react redux.pdfreact redux.pdf
react redux.pdf
 
React web development
React web developmentReact web development
React web development
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Introduction to Node JS.pdf
Introduction to Node JS.pdfIntroduction to Node JS.pdf
Introduction to Node JS.pdf
 
Node js
Node jsNode js
Node js
 
React native
React nativeReact native
React native
 
Nodejs functions & modules
Nodejs functions & modulesNodejs functions & modules
Nodejs functions & modules
 
jQuery
jQueryjQuery
jQuery
 
Web Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo FadojutimiWeb Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo Fadojutimi
 

Semelhante a Node js

Semelhante a Node js (20)

NodeJS.ppt
NodeJS.pptNodeJS.ppt
NodeJS.ppt
 
NodeJS.ppt
NodeJS.pptNodeJS.ppt
NodeJS.ppt
 
NodeJS.ppt
NodeJS.pptNodeJS.ppt
NodeJS.ppt
 
NodeJS introduction and examples of event loops
NodeJS introduction and examples of event loopsNodeJS introduction and examples of event loops
NodeJS introduction and examples of event loops
 
NodeJS
NodeJSNodeJS
NodeJS
 
Node js
Node jsNode js
Node js
 
Node
NodeNode
Node
 
NodeJS ecosystem
NodeJS ecosystemNodeJS ecosystem
NodeJS ecosystem
 
Node.js Workshop - Sela SDP 2015
Node.js Workshop  - Sela SDP 2015Node.js Workshop  - Sela SDP 2015
Node.js Workshop - Sela SDP 2015
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 
Proposal
ProposalProposal
Proposal
 
Making it fast: Zotonic & Performance
Making it fast: Zotonic & PerformanceMaking it fast: Zotonic & Performance
Making it fast: Zotonic & Performance
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
Introduction to Node.JS
Introduction to Node.JSIntroduction to Node.JS
Introduction to Node.JS
 
Node.js
Node.jsNode.js
Node.js
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN Stack
 
Node js internal
Node js internalNode js internal
Node js internal
 
Node.js: A Guided Tour
Node.js: A Guided TourNode.js: A Guided Tour
Node.js: A Guided Tour
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 

Mais de umesh patil (20)

Ccna security
Ccna security Ccna security
Ccna security
 
Array in c language
Array in c languageArray in c language
Array in c language
 
Array in c language
Array in c language Array in c language
Array in c language
 
Jquery Preparation
Jquery PreparationJquery Preparation
Jquery Preparation
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Static and dynamic polymorphism
Static and dynamic polymorphismStatic and dynamic polymorphism
Static and dynamic polymorphism
 
Introduction to asp .net
Introduction to asp .netIntroduction to asp .net
Introduction to asp .net
 
C language
C language C language
C language
 
Html and css presentation
Html and css presentationHtml and css presentation
Html and css presentation
 
Html Presentation
Html PresentationHtml Presentation
Html Presentation
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Oops and c fundamentals
Oops and c fundamentals Oops and c fundamentals
Oops and c fundamentals
 
Java script
Java scriptJava script
Java script
 
Function in c program
Function in c programFunction in c program
Function in c program
 
css and wordpress
css and wordpresscss and wordpress
css and wordpress
 
css and wordpress
css and wordpresscss and wordpress
css and wordpress
 
Php vs asp
Php vs aspPhp vs asp
Php vs asp
 
Ccna security
Ccna security Ccna security
Ccna security
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Node js

  • 1.  A JavaScript runtime environment running Google Chrome’s V8 engine  a.k.a. a server-side solution for JS  Compiles JS, making it really fast  Runs over the command line  Designed for high concurrency  Without threads or new processes  Never blocks, not even for I/O  Uses the CommonJS framework  Making it a little closer to a real OO language
  • 2.  Instead of threads Node uses an event loop with a stack  Alleviates overhead of context switching
  • 3. Threads Asynchronous Event-driven Lock application / request with listener-workers threads only one thread, which repeatedly fetches an event Using incoming-request model Using queue and then processes it multithreaded server might block the request which might involve multiple events manually saves state and then goes on to process the next event Using context switching no contention and no context switches Using multithreading environments where listener and workers threads are used frequently to take an incoming- request lock Using asynchronous I/O facilities (callbacks, not poll/select or O_NONBLOCK) environments
  • 4.  Request for “index.html” comes in  Stack unwinds and ev_loop goes to sleep  File loads from disk and is sent to the client
  • 5.  Servers do nothing but I/O  Scripts waiting on I/O requests degrades performance  To avoid blocking, Node makes use of the event driven nature of JS by attaching callbacks to I/O requests  Scripts waiting on I/O waste no space because they get popped off the stack when their non-I/O related code finishes executing
  • 6.
  • 7.  Use of JS on both the client and server-side should remove need to “context switch”  Client-side JS makes heavy use of the DOM, no access to files/databases  Server-side JS deals mostly in files/databases, no DOM  JSDom project for Node works for simple tasks, but not much else
  • 8. 1. It's fast 2. It can handle tons of concurrent requests 3. It's written in JavaScript (which means you can use the same code server side and client side) Platform Number of request per second PHP ( via Apache) 3187,27 Static ( via Apache ) 2966,51 Node.js 5569,30