SlideShare a Scribd company logo
1 of 33
What's so special about Node.js? giancarlo.valente@gmail.com twitter @gncvalente
years of front-end programming evolution now on server-side
javascript
Fundamental videography Ryan Dahl at JS.Conf 2009  show his creature http://jsconf.eu/2009/video_nodejs_by_ryan_dahl.html and also this ... http://vimeo.com/9968301
Fundamental videography Douglas Crockford:  “Crockford on JavaScript  Scene 6: Loopage”  August 2010 http://www.yuiblog.com/blog/2010/08/30/ yui-theater-douglas-crockford-crockford-on-javascript -scene-6-loopage-52-min
node.js is special
What does node.js, nginx, memcached  have in common ?
a C library called libevent
Apache vs Nginx http://blog.webfaction.com/a-little-holiday-present
Apache vs Nginx http://blog.webfaction.com/a-little-holiday-present
apache uses threads nginx uses an event loop
... it's a different approach on building servers ...  with differnt strenghts / weaknesses event loop approach  scales better when has to serve  many clients  with requests that doesn't need  so much "data crunching" elaboartion,  but a lot of I/O
Ryan's idea!  node.js is a thin layer  that glue 3 libraries togheter: V8 js engine  +  libev (event loop)  +  libeio (async I/O)
blocking I/O historically all programming languages have blocking I/O
but, a problem arise: the very expensive "data processing machine" is not used in a very efficient way
multi user systems use of timesharing,  in order to make the same computer multiuser
in our modern "server side" code, the same thing appens how do we solve this? simple, we do the same thing.  We invented the Threads!
but now the situation is like this Help !!! web real-time, long running sockets ... I've sent the newsletter with 90% discount !!! traffic jam !
has a different approach
event loop approach event loop is used from many years in: games graphical UIs ... servers
single thread server c1, c2, c3, c4 ---> S ---> I/O
multi-thread server c1 ---> T1 ---> I/O c2 ---> T2 ---> I/O c3 ---> T3 ---> I/O c4 ---> T4 ---> I/O
thread pool server c9, c5, c1  ---> T1 ---> I/O c10, c6, c2 ---> T2 ---> I/O c11, c7, c3 ---> T3 ---> I/O c12, c8, c4 ---> T4 ---> I/O
event loop c1 ---> ST --> async I/O c2 --->  c3 --->                  c4 --->                  c5 --->                  c6 --->                  c7 --->                  c8 --->                  c9 --->                  c10 --->                   c11 --->                   c12 --->
so what's the point ... also the browser is  mono-thread and works  with an event loop
when we write setTimeout('timeout_trigger()', 2000) we're not creating a new thread! (as sometimes I've heard ...) but we're subscribing  a new event,  which will run our callback,  2 seconds from now
so ... why all this hype ? who are the most expert professionals in event driven programming with non blocking I/O ?
the one that do this from years! front-end developers!
accidental evolution of a language (video) http://www.yuiblog.com/blog/2010/08/30/ yui-theater-douglas-crockford-crockford-on-javascript -scene-6-loopage-52-min
part 2
Do we all jump on the node.js train? maybe sometimes but it's important to understand what are the strenght of node so we can know how and when to use it.
alternatives ? yes, but we can talk about them next time ... :)
weaknesses monothread (?) (also principal strength point) .. you've to follow the rules non blocking operations, develop in evented style

More Related Content

What's hot

Android and Arduio mixed with Breakout js
Android and Arduio mixed with Breakout jsAndroid and Arduio mixed with Breakout js
Android and Arduio mixed with Breakout jsmusart Park
 
Nodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascriptNodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascriptDesiree Santos
 
2019.06.01 Konva.js 와 함께하는 canvas 2D 그래픽. 유튜브 썸네일 (미리보기 이미지) 제작툴 만들기
2019.06.01 Konva.js 와 함께하는 canvas 2D 그래픽. 유튜브 썸네일 (미리보기 이미지) 제작툴 만들기2019.06.01 Konva.js 와 함께하는 canvas 2D 그래픽. 유튜브 썸네일 (미리보기 이미지) 제작툴 만들기
2019.06.01 Konva.js 와 함께하는 canvas 2D 그래픽. 유튜브 썸네일 (미리보기 이미지) 제작툴 만들기JunHo Kim
 

What's hot (9)

Y server
Y serverY server
Y server
 
vmod workshop
vmod workshopvmod workshop
vmod workshop
 
Functional javascript
Functional javascriptFunctional javascript
Functional javascript
 
Perl containers
Perl containersPerl containers
Perl containers
 
Android and Arduio mixed with Breakout js
Android and Arduio mixed with Breakout jsAndroid and Arduio mixed with Breakout js
Android and Arduio mixed with Breakout js
 
Skyfall b sides-c00-l-ed5-sp-2013
Skyfall b sides-c00-l-ed5-sp-2013Skyfall b sides-c00-l-ed5-sp-2013
Skyfall b sides-c00-l-ed5-sp-2013
 
Nodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascriptNodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascript
 
Node.js
Node.jsNode.js
Node.js
 
2019.06.01 Konva.js 와 함께하는 canvas 2D 그래픽. 유튜브 썸네일 (미리보기 이미지) 제작툴 만들기
2019.06.01 Konva.js 와 함께하는 canvas 2D 그래픽. 유튜브 썸네일 (미리보기 이미지) 제작툴 만들기2019.06.01 Konva.js 와 함께하는 canvas 2D 그래픽. 유튜브 썸네일 (미리보기 이미지) 제작툴 만들기
2019.06.01 Konva.js 와 함께하는 canvas 2D 그래픽. 유튜브 썸네일 (미리보기 이미지) 제작툴 만들기
 

Similar to What's so special about node.js

44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON
 
Gatling - JUGL, 2012-09-13
Gatling  - JUGL, 2012-09-13Gatling  - JUGL, 2012-09-13
Gatling - JUGL, 2012-09-13Nicolas Rémond
 
Metasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on ArduinoMetasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on ArduinoKiwamu Okabe
 
HTML5: New UI Library for Games - Chad Austin
HTML5: New UI Library for Games - Chad AustinHTML5: New UI Library for Games - Chad Austin
HTML5: New UI Library for Games - Chad AustinChad Austin
 
4 Node.js Gotchas: What your ops team needs to know
4 Node.js Gotchas: What your ops team needs to know4 Node.js Gotchas: What your ops team needs to know
4 Node.js Gotchas: What your ops team needs to knowDynatrace
 
Docker in Production: Reality, Not Hype - DevOps Chicago
Docker in Production: Reality, Not Hype - DevOps ChicagoDocker in Production: Reality, Not Hype - DevOps Chicago
Docker in Production: Reality, Not Hype - DevOps Chicagobridgetkromhout
 
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...Felipe Prado
 
Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Seung Joon Choi
 
Node Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesNode Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesMakoto Inoue
 
Speeding up Programs with OpenACC in GCC
Speeding up Programs with OpenACC in GCCSpeeding up Programs with OpenACC in GCC
Speeding up Programs with OpenACC in GCCinside-BigData.com
 
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdfOpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdfssuser866937
 
Isolating GPU Access in its Own Process
Isolating GPU Access in its Own ProcessIsolating GPU Access in its Own Process
Isolating GPU Access in its Own ProcessPatricia Aas
 
Laptop Chip level repairing(CPU section)
Laptop Chip level repairing(CPU section)Laptop Chip level repairing(CPU section)
Laptop Chip level repairing(CPU section)chiptroniks
 
laptop repairing institute
laptop repairing institutelaptop repairing institute
laptop repairing institutechiptroniks
 
laptop repairing institute
laptop repairing institutelaptop repairing institute
laptop repairing institutechiptroniks
 
TomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloudTomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloudJean-Frederic Clere
 
Droids, java script and web connected hardware
Droids, java script and web connected hardwareDroids, java script and web connected hardware
Droids, java script and web connected hardwareAndrew Fisher
 
Integrating cloud stack with puppet
Integrating cloud stack with puppetIntegrating cloud stack with puppet
Integrating cloud stack with puppetPuppet
 

Similar to What's so special about node.js (20)

44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
 
Gatling - JUGL, 2012-09-13
Gatling  - JUGL, 2012-09-13Gatling  - JUGL, 2012-09-13
Gatling - JUGL, 2012-09-13
 
Metasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on ArduinoMetasepi team meeting #19: ATS application on Arduino
Metasepi team meeting #19: ATS application on Arduino
 
HTML5: New UI Library for Games - Chad Austin
HTML5: New UI Library for Games - Chad AustinHTML5: New UI Library for Games - Chad Austin
HTML5: New UI Library for Games - Chad Austin
 
4 Node.js Gotchas: What your ops team needs to know
4 Node.js Gotchas: What your ops team needs to know4 Node.js Gotchas: What your ops team needs to know
4 Node.js Gotchas: What your ops team needs to know
 
Docker in Production: Reality, Not Hype - DevOps Chicago
Docker in Production: Reality, Not Hype - DevOps ChicagoDocker in Production: Reality, Not Hype - DevOps Chicago
Docker in Production: Reality, Not Hype - DevOps Chicago
 
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
 
Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Webgl 기술동향 2011.8
Webgl 기술동향 2011.8
 
Node Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesNode Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup Slides
 
Gradle como alternativa a maven
Gradle como alternativa a mavenGradle como alternativa a maven
Gradle como alternativa a maven
 
Speeding up Programs with OpenACC in GCC
Speeding up Programs with OpenACC in GCCSpeeding up Programs with OpenACC in GCC
Speeding up Programs with OpenACC in GCC
 
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdfOpenMP-OpenACC-Offload-Cauldron2022-1.pdf
OpenMP-OpenACC-Offload-Cauldron2022-1.pdf
 
Isolating GPU Access in its Own Process
Isolating GPU Access in its Own ProcessIsolating GPU Access in its Own Process
Isolating GPU Access in its Own Process
 
Laptop Chip level repairing(CPU section)
Laptop Chip level repairing(CPU section)Laptop Chip level repairing(CPU section)
Laptop Chip level repairing(CPU section)
 
laptop repairing institute
laptop repairing institutelaptop repairing institute
laptop repairing institute
 
laptop repairing institute
laptop repairing institutelaptop repairing institute
laptop repairing institute
 
TomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloudTomcatCon: from a cluster to the cloud
TomcatCon: from a cluster to the cloud
 
(C)NodeJS
(C)NodeJS(C)NodeJS
(C)NodeJS
 
Droids, java script and web connected hardware
Droids, java script and web connected hardwareDroids, java script and web connected hardware
Droids, java script and web connected hardware
 
Integrating cloud stack with puppet
Integrating cloud stack with puppetIntegrating cloud stack with puppet
Integrating cloud stack with puppet
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 

What's so special about node.js

  • 1. What's so special about Node.js? giancarlo.valente@gmail.com twitter @gncvalente
  • 2. years of front-end programming evolution now on server-side
  • 4. Fundamental videography Ryan Dahl at JS.Conf 2009 show his creature http://jsconf.eu/2009/video_nodejs_by_ryan_dahl.html and also this ... http://vimeo.com/9968301
  • 5. Fundamental videography Douglas Crockford: “Crockford on JavaScript Scene 6: Loopage” August 2010 http://www.yuiblog.com/blog/2010/08/30/ yui-theater-douglas-crockford-crockford-on-javascript -scene-6-loopage-52-min
  • 7. What does node.js, nginx, memcached have in common ?
  • 8. a C library called libevent
  • 9. Apache vs Nginx http://blog.webfaction.com/a-little-holiday-present
  • 10. Apache vs Nginx http://blog.webfaction.com/a-little-holiday-present
  • 11. apache uses threads nginx uses an event loop
  • 12. ... it's a different approach on building servers ... with differnt strenghts / weaknesses event loop approach scales better when has to serve many clients with requests that doesn't need so much "data crunching" elaboartion, but a lot of I/O
  • 13. Ryan's idea! node.js is a thin layer that glue 3 libraries togheter: V8 js engine + libev (event loop) + libeio (async I/O)
  • 14. blocking I/O historically all programming languages have blocking I/O
  • 15. but, a problem arise: the very expensive "data processing machine" is not used in a very efficient way
  • 16. multi user systems use of timesharing, in order to make the same computer multiuser
  • 17. in our modern "server side" code, the same thing appens how do we solve this? simple, we do the same thing. We invented the Threads!
  • 18. but now the situation is like this Help !!! web real-time, long running sockets ... I've sent the newsletter with 90% discount !!! traffic jam !
  • 19. has a different approach
  • 20. event loop approach event loop is used from many years in: games graphical UIs ... servers
  • 21. single thread server c1, c2, c3, c4 ---> S ---> I/O
  • 22. multi-thread server c1 ---> T1 ---> I/O c2 ---> T2 ---> I/O c3 ---> T3 ---> I/O c4 ---> T4 ---> I/O
  • 23. thread pool server c9, c5, c1 ---> T1 ---> I/O c10, c6, c2 ---> T2 ---> I/O c11, c7, c3 ---> T3 ---> I/O c12, c8, c4 ---> T4 ---> I/O
  • 24. event loop c1 ---> ST --> async I/O c2 ---> c3 ---> c4 ---> c5 ---> c6 ---> c7 ---> c8 ---> c9 ---> c10 ---> c11 ---> c12 --->
  • 25. so what's the point ... also the browser is mono-thread and works with an event loop
  • 26. when we write setTimeout('timeout_trigger()', 2000) we're not creating a new thread! (as sometimes I've heard ...) but we're subscribing a new event, which will run our callback, 2 seconds from now
  • 27. so ... why all this hype ? who are the most expert professionals in event driven programming with non blocking I/O ?
  • 28. the one that do this from years! front-end developers!
  • 29. accidental evolution of a language (video) http://www.yuiblog.com/blog/2010/08/30/ yui-theater-douglas-crockford-crockford-on-javascript -scene-6-loopage-52-min
  • 31. Do we all jump on the node.js train? maybe sometimes but it's important to understand what are the strenght of node so we can know how and when to use it.
  • 32. alternatives ? yes, but we can talk about them next time ... :)
  • 33. weaknesses monothread (?) (also principal strength point) .. you've to follow the rules non blocking operations, develop in evented style