SlideShare a Scribd company logo
21.02.2017
Fatih Şimşek - Software Infrastructure
NodeJs
Open Source, cross platform
Huge community
Ryan Dahl, Joyent
Developed in 2009
Published in 2011 ( Linux + Windows )
Similar design to systems like Ruby's Event Machine or
Python's Twisted
Who is using NodeJs?
Success Stories
Yahoo: Node services handle around 1.680.000 – 2.000.000
requests/minute. Biggest Win: speed & ease of developement
Netflix: The team decided to use Node.js to achieve lightweight,
modular and fast application. As a result, the startup time of
their new app has been reduced by 70%
Linkedin: When compared with the previous Ruby on Rails
based version, the new mobile app is up to 20 times faster
Walmart: %55 of all traffic on Black Friday went to Node
servers. Not a single Node server went down
Success Stories
PayPal: Build a Node version of a Java app in half the time with
fewer developers. Node version of the app doubled the number
of requests/second. Request time dropped 35%
Groupon: In comparison with earlier Ruby on Rails platform,
web pages got faster by about 50% and are able to serve much
higher traffic
GoDaddy: 10x fewer servers to host our customer websites and
we reduced the Time To First Byte (TTFB) considerably from
~60ms to something around ~12ms
Github
NodeJs
Built on Chrome’s Javascript Runtime (V8)
Single thread, event oriented
Event-Driven with Non-blocking I/O
Use a Event Loop for Non-blocking I/O
Can handle thousands of concurrent connections with minimal
overhead (CPU/Memory)
40% JS and 60% C++
Traditional Server
New thread per request
The thread is blocked
during IO operations
Thesis
IO is expensive
Thread per connection
is memory expensive
Architecture
Client
Event loop
(main thread)
C++
Threadpool
(worker
threads)
Clients send HTTP requests
to Node.js server
An Event-loop is woken up by OS,
passes request and response objects
to the thread-pool
Long-running jobs run
on worker threads
Response is sent
back to main thread
via callback
Event loop returns
result to client
Architecture
API in Javascript
Relies on Google’s V8
runtime engine
Node Bindings allow for
server operations (IO,
network)
Libuv responsible for both
asynchronous I/O & event
loop
When to use NodeJs?
Highly Event driven & Heavily I/O bound
Chat application
Online game
Collaboration tool
Monitoring Dashboard
Trader’s Dashboard
When not to use NodeJs?
Heavy CPU intensive calculations on server-side
Concurrent Task based applications
Install
https://nodejs.org/en/download/
node –v (Node version)
Developement Environment
Web Storm
Sublime Text
Atom
Nodeclipse
Visual Studio
Visual Studio Code
DEMO
Node Frameworks & Tools
NPM (Package Manager)
Gulp / Grunt
Express.js
Frameworks built on Express.js (LoopBack / MEAN / Sails)
Restify
Mongoose
Socket.io
NPM
Package manager for Node
Bundled and installed automatically with the environment
Frequently Usage
• npm install --save package_name
• npm update
How Does it works?
• Read package.json
• Installs the dependencies in the local node_modules folder
• In global modes, it make a node module accessible to all
Express.js
Web application framework
Minimal and Flexible
Many Framework based on Express
Features
• MVC
• Routing
• Session Support
• Cookie Parsing
• Middleware (Request-Response Cycle)
• View Engines (Jade, Ejs, Vash)
Vash
Familiar Razor engine experience
No special template syntax to learn
Syntax:
Mongoose
Object Data Modelling for Node.js
Officially supported by 10gen,Inc
Features:
• Async and sync validation of models
• Model casting
• Object lifecycle management (hook save / validate)
• Query Builder
• Schema Deriven Design
DEMO
Node js
EventEmitter
Most of built-in Node libraries use it
Use Observer Pattern
Socket.io
Realtime application framework
Cross browser (Web socket + fallback)
Bi-directional communication
Automatic compression
IOS, Android, NativeScript support
Two parts
• Client side (run on browser)
• Server side (run on Node)
DEMO
Benchmark
Benchmark
Node js
Ad

More Related Content

What's hot (20)

Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
Samundra khatri
 
Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
Arvind Devaraj
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Rob O'Doherty
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
ArezooKmn
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
Edureka!
 
Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction
Kanika Gera
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Dinesh U
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
Dzmitry Naskou
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
Sunil Yadav
 
Intro to React
Intro to ReactIntro to React
Intro to React
Justin Reock
 
React Native
React NativeReact Native
React Native
ASIMYILDIZ
 
Nodejs
NodejsNodejs
Nodejs
Prem Sanil
 
Nodejs vatsal shah
Nodejs vatsal shahNodejs vatsal shah
Nodejs vatsal shah
Vatsal N Shah
 
Vue.js
Vue.jsVue.js
Vue.js
Jadson Santos
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 
The Benefits of Using React JS for Web Development!
The Benefits of Using React JS for Web Development!The Benefits of Using React JS for Web Development!
The Benefits of Using React JS for Web Development!
Baharika Sopori
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
Joseph de Castelnau
 
Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
sanskriti agarwal
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
Eyal Vardi
 
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
Samundra khatri
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Rob O'Doherty
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
ArezooKmn
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
Edureka!
 
Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction
Kanika Gera
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Dinesh U
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
Dzmitry Naskou
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
Sunil Yadav
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux
 
The Benefits of Using React JS for Web Development!
The Benefits of Using React JS for Web Development!The Benefits of Using React JS for Web Development!
The Benefits of Using React JS for Web Development!
Baharika Sopori
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
Eyal Vardi
 

Similar to Node js (20)

Introduction to Node.JS
Introduction to Node.JSIntroduction to Node.JS
Introduction to Node.JS
Collaboration Technologies
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
Khaled Mosharraf
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN Stack
Nir Noy
 
node.js interview questions and answers.
node.js interview questions and answers.node.js interview questions and answers.
node.js interview questions and answers.
JyothiAmpally
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
Kalp Corporate
 
Proposal
ProposalProposal
Proposal
Constantine Priemski
 
Node js
Node jsNode js
Node js
Chirag Parmar
 
Node.js vs Python_ Choosing the Right Back-end Technology for Your Next Proje...
Node.js vs Python_ Choosing the Right Back-end Technology for Your Next Proje...Node.js vs Python_ Choosing the Right Back-end Technology for Your Next Proje...
Node.js vs Python_ Choosing the Right Back-end Technology for Your Next Proje...
mohitd6
 
Real time web
Real time webReal time web
Real time web
Medhat Dawoud
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
Victor Reyes Heitmann
 
Quick introduction to nodeJs
Quick introduction to nodeJsQuick introduction to nodeJs
Quick introduction to nodeJs
Aram Rafeq
 
Node.js Web Development .pdf
Node.js Web Development .pdfNode.js Web Development .pdf
Node.js Web Development .pdf
Abanti Aazmin
 
GlobalsDB: Its significance for Node.js Developers
GlobalsDB: Its significance for Node.js DevelopersGlobalsDB: Its significance for Node.js Developers
GlobalsDB: Its significance for Node.js Developers
Rob Tweed
 
02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
Ahmed Elbassel
 
Day In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperDay In A Life Of A Node.js Developer
Day In A Life Of A Node.js Developer
Edureka!
 
Day in a life of a node.js developer
Day in a life of a node.js developerDay in a life of a node.js developer
Day in a life of a node.js developer
Edureka!
 
Node.js and .NET Core.pdf
Node.js and .NET Core.pdfNode.js and .NET Core.pdf
Node.js and .NET Core.pdf
Appdeveloper10
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdf
Sonia Simi
 
Nodejs
NodejsNodejs
Nodejs
Bhushan Patil
 
All You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdfAll You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdf
iDataScientists
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN Stack
Nir Noy
 
node.js interview questions and answers.
node.js interview questions and answers.node.js interview questions and answers.
node.js interview questions and answers.
JyothiAmpally
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
Kalp Corporate
 
Node.js vs Python_ Choosing the Right Back-end Technology for Your Next Proje...
Node.js vs Python_ Choosing the Right Back-end Technology for Your Next Proje...Node.js vs Python_ Choosing the Right Back-end Technology for Your Next Proje...
Node.js vs Python_ Choosing the Right Back-end Technology for Your Next Proje...
mohitd6
 
Quick introduction to nodeJs
Quick introduction to nodeJsQuick introduction to nodeJs
Quick introduction to nodeJs
Aram Rafeq
 
Node.js Web Development .pdf
Node.js Web Development .pdfNode.js Web Development .pdf
Node.js Web Development .pdf
Abanti Aazmin
 
GlobalsDB: Its significance for Node.js Developers
GlobalsDB: Its significance for Node.js DevelopersGlobalsDB: Its significance for Node.js Developers
GlobalsDB: Its significance for Node.js Developers
Rob Tweed
 
Day In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperDay In A Life Of A Node.js Developer
Day In A Life Of A Node.js Developer
Edureka!
 
Day in a life of a node.js developer
Day in a life of a node.js developerDay in a life of a node.js developer
Day in a life of a node.js developer
Edureka!
 
Node.js and .NET Core.pdf
Node.js and .NET Core.pdfNode.js and .NET Core.pdf
Node.js and .NET Core.pdf
Appdeveloper10
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdf
Sonia Simi
 
All You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdfAll You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdf
iDataScientists
 
Ad

Recently uploaded (20)

Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Ad

Node js

  • 1. 21.02.2017 Fatih Şimşek - Software Infrastructure
  • 2. NodeJs Open Source, cross platform Huge community Ryan Dahl, Joyent Developed in 2009 Published in 2011 ( Linux + Windows ) Similar design to systems like Ruby's Event Machine or Python's Twisted
  • 3. Who is using NodeJs?
  • 4. Success Stories Yahoo: Node services handle around 1.680.000 – 2.000.000 requests/minute. Biggest Win: speed & ease of developement Netflix: The team decided to use Node.js to achieve lightweight, modular and fast application. As a result, the startup time of their new app has been reduced by 70% Linkedin: When compared with the previous Ruby on Rails based version, the new mobile app is up to 20 times faster Walmart: %55 of all traffic on Black Friday went to Node servers. Not a single Node server went down
  • 5. Success Stories PayPal: Build a Node version of a Java app in half the time with fewer developers. Node version of the app doubled the number of requests/second. Request time dropped 35% Groupon: In comparison with earlier Ruby on Rails platform, web pages got faster by about 50% and are able to serve much higher traffic GoDaddy: 10x fewer servers to host our customer websites and we reduced the Time To First Byte (TTFB) considerably from ~60ms to something around ~12ms
  • 7. NodeJs Built on Chrome’s Javascript Runtime (V8) Single thread, event oriented Event-Driven with Non-blocking I/O Use a Event Loop for Non-blocking I/O Can handle thousands of concurrent connections with minimal overhead (CPU/Memory) 40% JS and 60% C++
  • 8. Traditional Server New thread per request The thread is blocked during IO operations
  • 9. Thesis IO is expensive Thread per connection is memory expensive
  • 10. Architecture Client Event loop (main thread) C++ Threadpool (worker threads) Clients send HTTP requests to Node.js server An Event-loop is woken up by OS, passes request and response objects to the thread-pool Long-running jobs run on worker threads Response is sent back to main thread via callback Event loop returns result to client
  • 11. Architecture API in Javascript Relies on Google’s V8 runtime engine Node Bindings allow for server operations (IO, network) Libuv responsible for both asynchronous I/O & event loop
  • 12. When to use NodeJs? Highly Event driven & Heavily I/O bound Chat application Online game Collaboration tool Monitoring Dashboard Trader’s Dashboard
  • 13. When not to use NodeJs? Heavy CPU intensive calculations on server-side Concurrent Task based applications
  • 15. Developement Environment Web Storm Sublime Text Atom Nodeclipse Visual Studio Visual Studio Code
  • 16. DEMO
  • 17. Node Frameworks & Tools NPM (Package Manager) Gulp / Grunt Express.js Frameworks built on Express.js (LoopBack / MEAN / Sails) Restify Mongoose Socket.io
  • 18. NPM Package manager for Node Bundled and installed automatically with the environment Frequently Usage • npm install --save package_name • npm update How Does it works? • Read package.json • Installs the dependencies in the local node_modules folder • In global modes, it make a node module accessible to all
  • 19. Express.js Web application framework Minimal and Flexible Many Framework based on Express Features • MVC • Routing • Session Support • Cookie Parsing • Middleware (Request-Response Cycle) • View Engines (Jade, Ejs, Vash)
  • 20. Vash Familiar Razor engine experience No special template syntax to learn Syntax:
  • 21. Mongoose Object Data Modelling for Node.js Officially supported by 10gen,Inc Features: • Async and sync validation of models • Model casting • Object lifecycle management (hook save / validate) • Query Builder • Schema Deriven Design
  • 22. DEMO
  • 24. EventEmitter Most of built-in Node libraries use it Use Observer Pattern
  • 25. Socket.io Realtime application framework Cross browser (Web socket + fallback) Bi-directional communication Automatic compression IOS, Android, NativeScript support Two parts • Client side (run on browser) • Server side (run on Node)
  • 26. DEMO

Editor's Notes

  • #3: Ryan is an American freelance programmer living in of Germany. His work invariably involves interruptible parsers, event loops, and response time histograms. He is the creator of several open source projects including the Ebb web server and the "EY" load balancer module for Nginx. Joyent, ABD'nin San Fransisco kenti merkezli yazılım firması.
  • #5: 9 Famous Apps Built with Node.js https://brainhub.eu/blog/2016/05/30/9-famous-apps-using-node-js/
  • #6: 9 Famous Apps Built with Node.js https://brainhub.eu/blog/2016/05/30/9-famous-apps-using-node-js/
  • #11: Single thread to handle callbacks Ideal for waiting for I/O calls (network, filesystem, database) Not ideal for CPU intensive operations -> solution fork new child process No thread management No need to synchronization Creating scalable web servers is easy
  • #12: The request to read the file goes through Node bindings to libuv. Then libuv gives the task of reading the file to a thread. When the thread completes reading the file into the buffer, the results goes to V8 and then through the Node bindings in the form of a callback function. In the callback shown the data argument is a Buffer with the file data.
  • #16: Nodeclipse: Built on Eclipse
  • #17: Single Thread
  • #18: Restify = Rest API comes with automatic DTrace support for all your handlers, if you're running on a platform that supports Dtrace Dtrace is a comprehensive dynamic tracing framework created by Sun Microsystems for troubleshooting kernel and application problems on production systems in real time
  • #20: You can set request time before routing on middleware
  • #21: Jade / EJS = http://wildermuth.com/2014/3/24/Choose_Your_Own_Adventure_with_Node_js_View_Engines Vash = https://www.upnxt.com/blog/node-with-express-vash-sqlite http://kirbysayshi.com/2012/04/17/vash.html
  • #22: Table = Collection Record = Document http://www.slideshare.net/yuriybogomolov/ybo-mongo-dbmeetup
  • #23: Sample ExpressJs http://getbootstrap.com/css/#forms http://getbootstrap.com/components/#list-group http://getbootstrap.com/components/#glyphicons-examples
  • #25: You can crete your Node Libraries build on EventEmitter EventEmitter functions : addListener(event, listener) on(event, listener) once(event, listener) removeListener(event, listener) removeAllListeners([event]) setMaxListeners(n) listeners(event) listenerCount(emitter, event)
  • #26: Web socket is not fully supported in all browser yet. İf Web socket is available, we will use it, if it is not, it will try fallback transports until one of them works Fallback tranports: Web sockets Flash sockets Ajax long polling Ajax streaming İframe Json polling
  • #27: Socket.io
  • #28: https://gist.github.com/ilyaigpetrov/f6df3e6f825ae1b5c7e2 https://tipaltilabs.com/2016/07/09/node-js-vs-iis-webapi-async/ OWIN idea on Asp.net after Nodejs
  • #30: http://www.wintellect.com/devcenter/jlane/five-reasons-asp-net-developers-should-care-about-node-js http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx