SlideShare a Scribd company logo
Critical Thinking in Node.js
Morgan Cheng
What is Node.JS?
History
• 2009, Ryan Dahl published Node.js
• Bla Bla Bla
• https://blog.risingstack.com/history-of-node-js/
io.js & node.js
Critical thinking in Node.js
Why choose JavaScript?
JavaScript is clean in I/O
Critical thinking in Node.js
Asynchronous Programming
Scale Out? Scale Up?
Single Thread?
IT IS A JOKE
Event Loop
"Everything runs in parallel except your code"
How about add Threading in JavaScript?
Critical thinking in Node.js
Promise vs CPS
CPS
• Easy to callback-hell
• High Performant
Promise
• Seems winning
Rocks for I/O intensive job
Sucks for CPU intensive job
But, Node.js might still fail your Expectation
Watch Out
•Sync API
•Loop
•Recursion
•GC
It Could Freeze You!
Garbage Collection
Real Single Threading
This is Node.js
Happy?
Any Question?

More Related Content

PPTX
Breaking the eggshell: From .NET to Node.js
PPTX
Node Primer
PDF
Understand How Node.js and Core Features Works
PDF
Serverless framework와 CircleCI를 통한 NoOps 맛보기
PDF
Node.js for .NET Developers
PPTX
NodeJS and what is actually does
PDF
PHP Silex and Microsoft Azure @ThankYouMotion
PDF
Intro to Node.js (for .NET Developers)
Breaking the eggshell: From .NET to Node.js
Node Primer
Understand How Node.js and Core Features Works
Serverless framework와 CircleCI를 통한 NoOps 맛보기
Node.js for .NET Developers
NodeJS and what is actually does
PHP Silex and Microsoft Azure @ThankYouMotion
Intro to Node.js (for .NET Developers)

What's hot (20)

PDF
Why we released the kraken
PDF
MEAN Stack - Google Developers Live 10/03/2013
PPTX
Scalable server component using NodeJS & ExpressJS
PDF
Build App with Nodejs - YWC Workshop
PDF
Back to the future with static site generators
PDF
Use all the buzzwords
PDF
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
PDF
SOAP calls in Clojure application
PDF
Javantura 2014 - Java 8 JavaScript Nashorn
PDF
Scalability vs. Performance
PDF
Realtime MVC with Sails.js
PPT
Next generation frontend tooling
PPTX
Node.Js: Basics Concepts and Introduction
PDF
Horizontally Scaling Node.js and WebSockets
PDF
JSFoo-2017 Takeaways
PDF
WebAssembly vs JavaScript: What is faster?
PDF
WebAssembly in Houdini CSS, is it possible?
PPT
Lesson learned of twitter storm
PDF
Intro to Node.js
PDF
Node.js for beginner
Why we released the kraken
MEAN Stack - Google Developers Live 10/03/2013
Scalable server component using NodeJS & ExpressJS
Build App with Nodejs - YWC Workshop
Back to the future with static site generators
Use all the buzzwords
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
SOAP calls in Clojure application
Javantura 2014 - Java 8 JavaScript Nashorn
Scalability vs. Performance
Realtime MVC with Sails.js
Next generation frontend tooling
Node.Js: Basics Concepts and Introduction
Horizontally Scaling Node.js and WebSockets
JSFoo-2017 Takeaways
WebAssembly vs JavaScript: What is faster?
WebAssembly in Houdini CSS, is it possible?
Lesson learned of twitter storm
Intro to Node.js
Node.js for beginner
Ad

Viewers also liked (18)

PPTX
Cckt 2006 2010
PPTX
Realtime web open house
PPTX
Implementing jsp tag extensions
PDF
In Situ Bioremediation: When Does It Work?
PPTX
What’s new in ECMAScript 6.0
PPTX
Why TypeScript?
PDF
Hyderabad LISS III Image Interpretation (Using ERDAS Imagine)
PPTX
Protocolos
PPTX
ERDAS IMAGINE
PDF
Bec pelc+2010+-+science+and+health
PPTX
Oraclesql
PPTX
Network Security Terminologies
PDF
GEOLOGICAL - MINING EXPLORATION
PDF
#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...
PPTX
Application of Basic Remote Sensing in Geology
PPTX
Typescript Fundamentals
PPTX
JavaScript Debugging Tips & Tricks
Cckt 2006 2010
Realtime web open house
Implementing jsp tag extensions
In Situ Bioremediation: When Does It Work?
What’s new in ECMAScript 6.0
Why TypeScript?
Hyderabad LISS III Image Interpretation (Using ERDAS Imagine)
Protocolos
ERDAS IMAGINE
Bec pelc+2010+-+science+and+health
Oraclesql
Network Security Terminologies
GEOLOGICAL - MINING EXPLORATION
#36.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_재직자환급교육,실업자교육,국비지원교육, 자바교육,구...
Application of Basic Remote Sensing in Geology
Typescript Fundamentals
JavaScript Debugging Tips & Tricks
Ad

More from Morgan Cheng (13)

PPT
React & Redux in Hulu
PPTX
Flux and redux
PDF
Engineering excellence 卓越工程
PPTX
High Performance Mobile Web
PPTX
YUI vs jQuery: to Build Large Scale JavaScript App
PPTX
Single Page WebApp Architecture
PPTX
Secrets of Effective Presentation
PPTX
Build Lightweight Web Module
PPTX
Optimize URL for Performance
PPTX
F2E's Creeds
PPTX
Comet Server Push Over Web
PPTX
Mobile Web on Touch Event and YUI
PPTX
Embracing YUI3 and Frontend Perf
React & Redux in Hulu
Flux and redux
Engineering excellence 卓越工程
High Performance Mobile Web
YUI vs jQuery: to Build Large Scale JavaScript App
Single Page WebApp Architecture
Secrets of Effective Presentation
Build Lightweight Web Module
Optimize URL for Performance
F2E's Creeds
Comet Server Push Over Web
Mobile Web on Touch Event and YUI
Embracing YUI3 and Frontend Perf

Recently uploaded (20)

PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
web development for engineering and engineering
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Digital Logic Computer Design lecture notes
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
additive manufacturing of ss316l using mig welding
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Sustainable Sites - Green Building Construction
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
bas. eng. economics group 4 presentation 1.pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
web development for engineering and engineering
R24 SURVEYING LAB MANUAL for civil enggi
Digital Logic Computer Design lecture notes
CH1 Production IntroductoryConcepts.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
additive manufacturing of ss316l using mig welding
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
OOP with Java - Java Introduction (Basics)
Embodied AI: Ushering in the Next Era of Intelligent Systems
Sustainable Sites - Green Building Construction
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Internet of Things (IOT) - A guide to understanding
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx

Critical thinking in Node.js

Editor's Notes

  • #2: This presentation is to help you be critical in choosing Node.js as tech solution, not to boost Node.js
  • #3: Node.js can be anywhere, except space shuttle.
  • #5: io.js a fork of original node.js, because some people is not satisfied by slow steps of node evolution. When these two merge, node.js is still 0.xxx, but io.js has reached v3.3.1. So, the new version of node.js starts with v4. This story sounds similar. Yes, same happens for HTML5. LTS(v4, v6) vs Current(v5) LTS focus on stability and security. Current focus on new features.
  • #6: Node has only very basic and raw functionality It is NPM that makes it powerful.
  • #7: JavaScript is asynchronous, by default. JavaScript had no existing IO libraries so we could start clean with non-blocking IO. Example. Crawler in .NET
  • #9: Actually, Universal JavaScript is the biggest incentive. Frontend Engineers are most loyal language user, since they have not much choice.
  • #10: It is difficult, but not impossible.
  • #11: Node.js helps scale-up, not scale-out. Actually, it doesn’t implement share-nothing-architecture like PHP. As a result, it may suffer some scalability problems.
  • #13: http://softwareengineeringdaily.com/2015/08/02/how-does-node-js-work-asynchronously-without-multithreading/ It is a hoax that Node process has only single thread. There are multiple threads, but your code always run on single thread. Check it out: ps –M {pid} Single Threaded brings pros: No race condition; Better performance since thread switching is not necessary.
  • #14: In Node.js everything runs in parallel, except your code. What this means is that all I/O code that you write in Node.js is non-blocking, while (conversely) all non-I/O code that you write in Node.js is blocking.
  • #16: Dougalus Crockford’s response: never!!! JavaScript is application language, not system language. https://www.youtube.com/watch?v=QgwSUtYSUqA
  • #17: https://blog.jcoglan.com/2013/03/30/callbacks-are-imperative-promises-are-functional-nodes-biggest-missed-opportunity/ Ryan Dahl decides to take CPS way.
  • #21: Example. Read cson config in view So, every server application should have two phase: Init phase; Execution Phase.
  • #22: Example: Read cson from loop in view. Example: _.merge Example: Plurk
  • #24: Node.js GC is actually google v8 js engine GC. So, it runs in single thread. Example, plurk moves away from node.js