SlideShare una empresa de Scribd logo
1 de 24
NODE.JS
HOW JAVASCRIT IS CHANGING SERVER PROGRAMMING
MAXIME LEMAITRE – 16/12/2013
Agenda
• Introduction
• What makes Node so ___ ?
• How to Node ….
– Hello world
– Tweeter Console
• NPM to the rescue
• … and not to Node
– Grunt
– Redis Commander
• Node.js and Microsoft
• Questions

“Most languages were designed to
solve computational problems, but
Node.js is different “

“ Node.js was designed from the
ground up to efficiently handle the
communication that is at the heart
of modern web applications “
Quick overview
•

Brief History
– Invented by Ryan Dahl of Joyent, spring 2009 (4 years)
• Solving the upload progress bar problem on Flickr
– Jan. 2012 Dahl stepped aside, promoting coworker and NPM creator Isaac Schlueter
– First Stable Build on Windows : v0.6.0 (November 2011)
• With the Help of Microsoft

Node's goal is to provide an easy way to build
scalable network programs
•

Now
– Development and maintenance is sponsored by Joyent (Cloud infrastructure)
• But many contributors : StrongLoop, Voxer, Joyent, Microsoft, Mozilla, …
– #3 repository on GitHub (500 contributors, 10 000 commits)
– V0.10 (March 2013) : 35 000 downloads /day, 1 000 000 downloads in 3 months
– Run on Linux, Mac, Windows, … and in the Cloud (Supported by major Cloud Platforms)
“I/O needs to be done differently”
Inspiration
•

Many web applications have code, like this:

•

What is the software doing while it queries the database?
In many cases, just waiting for the response.
(blocks the thread)
But a line of code like this

allows the program to return to the event loop immediately.
This is how I/O should be done.
Typical I/O latency
What makes Node so special ?
• Server-side JavaScript
– most widely used programing language of the web
– async by nature

• Non-blocking I/O
– do not wait slow ressources to respond

• Built using V8 JavaScript Engine (from Chrome)
– very fast and getting faster after each release

• « Event-based » or « Asynchronous »
– all execution initiated by an event
– « Everything runs in parallel except your code »

• Single-threaded Event Loop, limited to one CPU
– no threads
– no locks or no execution concurrency
– events are executed in order
Node.js Processing Model
What makes Node.js so popular ?
• It’s fast and scalable
• JavaScript all the way
– Minimal learning curve
– JS is now the ubiquitous language of the web
– Allow code re-use between front-end and back-end.

• Web centric
– Being based on JS and V8, node.js naturally attracts mainly web developers

• Minimalist Core API and efficient module system
• Active development
• Always asynchronous
– All I/O done in Node is by design asynchronous

• Non-fragmented community
What makes Node.js so difficult ?
Asynchronous code

Single Event Loop

if # entries = 10,000
doSomething() takes ~1ms
you block for 10 seconds!

each node process is bound to one core
everything you do blocks

Easy to write code like this
(async may help you)
Companies using node

https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node
Finally, is it good for everything ?
• Good Use Case
–
–
–
–
–
–
–

JSON API
Streaming
Real-time Pub/Sub systems
Chatty apps
Dashboards
Queues
Proxy

• Bad Use Case
– CPU heavy apps
– Memory intensive apps
– Simple CRUD / HTML apps
Node.js at Paypal
Nov 2013, https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/
•

Node.js version Vs Java
– Built almost twice as fast with fewer people
– Written in 33% fewer lines of code
– Constructed with 40% fewer files

•

Node.js performance Vs Java
– Double the requests per second vs. the Java application
– 35% decrease in the average response time

12
Hello World
Tweeter Console
NPM : Node package manager
•

innovation through modularity
Set of publicly available, reusable components, available through easy installation
via an online repository, with version and dependency management
– Preinstalled with Node.js
– Approx. 50 544 online packages (Dec 2013)
– +150 packages per day (#1 of all packages managers)

•

Features
–
–
–
–

publish, install, discover, and develop node programs
open to all, and anyone can publish their own module
puts modules in a place where node.js can find them
Manage dependencies & modules with package.json

“Node.js is successful because of npm”
“don’t worry about multiple versions causing
conflicts because npm will automatically partition
them. In other words: it just works.”
Interesting Modules
Express
Underscore
Commander
Async
Socket.IO
node_redis
Jade
Request
node-unit
winston
Forever
node-sqlserver
google-api
azure-sdk

Web application framework for node
JavaScript's utility belt _
Complete solution for node.js command-line interfaces
Higher-order functions and common patterns for asynchronous code
Realtime framework, with WebSockets and cross-browser fallbacks support
redis client for node
Server-side templating engine
Standard HTTP client
Easy unit testing for node.js and the browser
a multi-transport async logging library for node.js
simple CLI tool for ensuring that a given script runs continuously
Microsoft Driver for Node.js for SQL Server
Official client library for accessing Google APIs
Azure SDK for Node.js
… also more than 50 000 packages
Grunt : The Javascript Task Runner
The Build Tool for JavaScript and Web Applications
“Grunt is a task-based command line build tool for JavaScript projects.”
Use the Power of JavaScript/Node to Automating Repetitive Tasks
•

Common Build Tasks (configured in gruntfile.js)
–
–
–
–
–
–
–
–
–

•

Concatenate
Compress
Minify
Linting (JsLint, JsHint)
Testing
Optimize Image
Monitor Files
Publish
YOUR TASK HERE

grunt-contrib-concat
grunt-contrib-compress
grunt-contrib-htmlmin, grunt-contrib-cssmin
grunt-contrib-jshint , grunt-contrib-csslint
grunt-contrib-qunit, grunt-contrib-nodeunit
grunt-contrib-imagemin

grunt-contrib-watch
grunt-contrib-copy

Who uses Grunt ?
– Twitter, Jquery, Bootstrap, WordPress, Adobe, Pinterest, Facebook, …
Redis Commander
Built with Node
IISNode
Host Node.js app in IIS
•

Native IIS module that allows hosting
of node.js applications in IIS on
Windows.
–
–
–
–
–
–
–

Node Process management
Side by side with other content types.
Scalability on multi-core servers
Integrated debugging
Auto-update
Access to logs over HTTP
Minimal changes to node.js application
code
– Integrated management experience
– Other IIS benefits : Port
sharing, security, URL
rewriting, compression, caching, loggin
g

Important Node : Windows Azure Node.js
hosting is powered by IISNode !
Node.js for Visual Studio Users
Node.js Tools for Visual Studio (Alpha)
Turns Visual Studio into a
Node.js IDE.
• Editing
• Intellisense
• Profiling
• Npm integration
• Debugging locally and
remotely
(Windows/Mac/Linux)
• Azure Deployment
• …
You can also try
Questions
References
•

Really good introduction
– http://www.nodebeginner.org/
– http://nodejs.developpez.com/tutoriels/javascript/node-js-livre-debutant/ - FRENCH-

•
•
•
•
•
•
•
•
•
•
•

http://nodejs.org/ (Official)
http://nodejs.org/api/ (Official Api)
http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js
https://github.com/maxogden/art-of-node#the-art-of-node
http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html
http://package.json.nodejitsu.com/
https://blog.nodejitsu.com/npm-innovation-through-modularity
https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/
http://www.youtube.com/watch?v=SAc0vQCC6UQ
http://cgbystrom.com/articles/six-reasons-why-node-js-is-so-popular/
http://www.ebaytechblog.com/2013/05/17/how-we-built-ebays-first-node-jsapplication/
Find out more
•

On https://techblog.betclicgroup.com/
About Betclic
•
•

•

Betclic Everest Group, one of the world leaders in online gaming, has a unique portfolio
comprising various complementary international brands: Betclic, Everest Gaming, bet-athome.com, Expekt…
Active in 100 countries with more than 12 million customers worldwide, the Group is
committed to promoting secure and responsible gaming and is a member of several
international professional associations including the EGBA (European Gaming and Betting
Association) and the ESSA (European Sports Security Association).
Through our brands, Betclic Everest Group places expertise, technological know-how and
security at the heart of our strategy to deliver an on-line gaming offer attuned to the passion
of our players.

Más contenido relacionado

La actualidad más candente

Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?John Rofrano
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerJohn Rofrano
 
Afrimadoni the power of docker
Afrimadoni   the power of dockerAfrimadoni   the power of docker
Afrimadoni the power of dockerPHP Indonesia
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJSZahid Mahir
 
Undine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development EnvironmentsUndine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development EnvironmentsDavid Watson
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaNurul Ferdous
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013dotCloud
 
Discussing the difference between docker dontainers and virtual machines
Discussing the difference between docker dontainers and virtual machinesDiscussing the difference between docker dontainers and virtual machines
Discussing the difference between docker dontainers and virtual machinesSteven Grzbielok
 
Engage 2019: Introduction to Node-Red
Engage 2019: Introduction to Node-RedEngage 2019: Introduction to Node-Red
Engage 2019: Introduction to Node-RedPaul Withers
 
Project Zero For Javapolis 2007
Project Zero For Javapolis 2007Project Zero For Javapolis 2007
Project Zero For Javapolis 2007Jason McGee
 
Docker taylor swift and protection v06
Docker taylor swift and protection v06Docker taylor swift and protection v06
Docker taylor swift and protection v06marketingunitrends
 
Containers vs. VMs: It's All About the Apps!
Containers vs. VMs: It's All About the Apps!Containers vs. VMs: It's All About the Apps!
Containers vs. VMs: It's All About the Apps!Steve Wilson
 
Docker-N-Beyond
Docker-N-BeyondDocker-N-Beyond
Docker-N-Beyondsantosh007
 
Container Landscape in 2017
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017Arun Gupta
 
Containers in depth – understanding how containers work to better work with c...
Containers in depth – understanding how containers work to better work with c...Containers in depth – understanding how containers work to better work with c...
Containers in depth – understanding how containers work to better work with c...All Things Open
 
Javantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornJavantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornMiroslav Resetar
 
Introducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsIntroducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsRichard Rodger
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development EnvironmentsOscar Merida
 

La actualidad más candente (20)

Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
 
Afrimadoni the power of docker
Afrimadoni   the power of dockerAfrimadoni   the power of docker
Afrimadoni the power of docker
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Undine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development EnvironmentsUndine: Turnkey Drupal Development Environments
Undine: Turnkey Drupal Development Environments
 
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, DhakaJavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
 
Discussing the difference between docker dontainers and virtual machines
Discussing the difference between docker dontainers and virtual machinesDiscussing the difference between docker dontainers and virtual machines
Discussing the difference between docker dontainers and virtual machines
 
Engage 2019: Introduction to Node-Red
Engage 2019: Introduction to Node-RedEngage 2019: Introduction to Node-Red
Engage 2019: Introduction to Node-Red
 
Project Zero For Javapolis 2007
Project Zero For Javapolis 2007Project Zero For Javapolis 2007
Project Zero For Javapolis 2007
 
Docker taylor swift and protection v06
Docker taylor swift and protection v06Docker taylor swift and protection v06
Docker taylor swift and protection v06
 
Containers vs. VMs: It's All About the Apps!
Containers vs. VMs: It's All About the Apps!Containers vs. VMs: It's All About the Apps!
Containers vs. VMs: It's All About the Apps!
 
Docker-N-Beyond
Docker-N-BeyondDocker-N-Beyond
Docker-N-Beyond
 
Container Landscape in 2017
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017
 
Containers in depth – understanding how containers work to better work with c...
Containers in depth – understanding how containers work to better work with c...Containers in depth – understanding how containers work to better work with c...
Containers in depth – understanding how containers work to better work with c...
 
Javantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornJavantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript Nashorn
 
Meanstack overview
Meanstack overviewMeanstack overview
Meanstack overview
 
Automated infrastructure
Automated infrastructureAutomated infrastructure
Automated infrastructure
 
Introducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsIntroducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.js
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
 

Similar a Mini-Training: Node.js

Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)Chris Cowan
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.jsKasey McCurdy
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJSJITENDRA KUMAR PATEL
 
An Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureAn Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureTroy Miles
 
A Journey Begin with Node.js
A Journey Begin with Node.jsA Journey Begin with Node.js
A Journey Begin with Node.jsKhalid Farhan
 
Quick introduction to nodeJs
Quick introduction to nodeJsQuick introduction to nodeJs
Quick introduction to nodeJsAram Rafeq
 
A295 nodejs-knowledge-accelerator
A295   nodejs-knowledge-acceleratorA295   nodejs-knowledge-accelerator
A295 nodejs-knowledge-acceleratorMichael Dawson
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS Ganesh Kondal
 
Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)brendankowitz
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jibanJibanananda Sana
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivRon Perlmuter
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Ganesh Kondal
 

Similar a Mini-Training: Node.js (20)

Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
 
An Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows AzureAn Introduction to Node.js Development with Windows Azure
An Introduction to Node.js Development with Windows Azure
 
A Journey Begin with Node.js
A Journey Begin with Node.jsA Journey Begin with Node.js
A Journey Begin with Node.js
 
Quick introduction to nodeJs
Quick introduction to nodeJsQuick introduction to nodeJs
Quick introduction to nodeJs
 
A295 nodejs-knowledge-accelerator
A295   nodejs-knowledge-acceleratorA295   nodejs-knowledge-accelerator
A295 nodejs-knowledge-accelerator
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)Going offline with JS (DDD Sydney)
Going offline with JS (DDD Sydney)
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
 
Node.js Chapter1
Node.js Chapter1Node.js Chapter1
Node.js Chapter1
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Node.js for beginner
Node.js for beginnerNode.js for beginner
Node.js for beginner
 
NodeJS Presentation
NodeJS PresentationNodeJS Presentation
NodeJS Presentation
 
18_Node.js.ppt
18_Node.js.ppt18_Node.js.ppt
18_Node.js.ppt
 

Más de Betclic Everest Group Tech Team

Mini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation DemystifiedMini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation DemystifiedBetclic Everest Group Tech Team
 

Más de Betclic Everest Group Tech Team (20)

Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)
 
Mini training - Moving to xUnit.net
Mini training - Moving to xUnit.netMini training - Moving to xUnit.net
Mini training - Moving to xUnit.net
 
Mini training - Introduction to Microsoft Azure Storage
Mini training - Introduction to Microsoft Azure StorageMini training - Introduction to Microsoft Azure Storage
Mini training - Introduction to Microsoft Azure Storage
 
Akka.Net
Akka.NetAkka.Net
Akka.Net
 
Mini training- Scenario Driven Design
Mini training- Scenario Driven DesignMini training- Scenario Driven Design
Mini training- Scenario Driven Design
 
Email Management in Outlook
Email Management in OutlookEmail Management in Outlook
Email Management in Outlook
 
Mini-Training: SSO with Windows Identity Foundation
Mini-Training: SSO with Windows Identity FoundationMini-Training: SSO with Windows Identity Foundation
Mini-Training: SSO with Windows Identity Foundation
 
Training - What is Performance ?
Training  - What is Performance ?Training  - What is Performance ?
Training - What is Performance ?
 
Mini-Training: Docker
Mini-Training: DockerMini-Training: Docker
Mini-Training: Docker
 
Mini Training Flyway
Mini Training FlywayMini Training Flyway
Mini Training Flyway
 
Mini-Training: NDepend
Mini-Training: NDependMini-Training: NDepend
Mini-Training: NDepend
 
Management 3.0 Workout
Management 3.0 WorkoutManagement 3.0 Workout
Management 3.0 Workout
 
Lean for Business
Lean for BusinessLean for Business
Lean for Business
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Training – Going Async
Training – Going AsyncTraining – Going Async
Training – Going Async
 
Mini-Training: Mobile UX Trends
Mini-Training: Mobile UX TrendsMini-Training: Mobile UX Trends
Mini-Training: Mobile UX Trends
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
Mini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation DemystifiedMini-training: Personalization & Recommendation Demystified
Mini-training: Personalization & Recommendation Demystified
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 

Último

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Último (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Mini-Training: Node.js

  • 1. NODE.JS HOW JAVASCRIT IS CHANGING SERVER PROGRAMMING MAXIME LEMAITRE – 16/12/2013
  • 2. Agenda • Introduction • What makes Node so ___ ? • How to Node …. – Hello world – Tweeter Console • NPM to the rescue • … and not to Node – Grunt – Redis Commander • Node.js and Microsoft • Questions “Most languages were designed to solve computational problems, but Node.js is different “ “ Node.js was designed from the ground up to efficiently handle the communication that is at the heart of modern web applications “
  • 3. Quick overview • Brief History – Invented by Ryan Dahl of Joyent, spring 2009 (4 years) • Solving the upload progress bar problem on Flickr – Jan. 2012 Dahl stepped aside, promoting coworker and NPM creator Isaac Schlueter – First Stable Build on Windows : v0.6.0 (November 2011) • With the Help of Microsoft Node's goal is to provide an easy way to build scalable network programs • Now – Development and maintenance is sponsored by Joyent (Cloud infrastructure) • But many contributors : StrongLoop, Voxer, Joyent, Microsoft, Mozilla, … – #3 repository on GitHub (500 contributors, 10 000 commits) – V0.10 (March 2013) : 35 000 downloads /day, 1 000 000 downloads in 3 months – Run on Linux, Mac, Windows, … and in the Cloud (Supported by major Cloud Platforms)
  • 4. “I/O needs to be done differently” Inspiration • Many web applications have code, like this: • What is the software doing while it queries the database? In many cases, just waiting for the response. (blocks the thread) But a line of code like this allows the program to return to the event loop immediately. This is how I/O should be done.
  • 6. What makes Node so special ? • Server-side JavaScript – most widely used programing language of the web – async by nature • Non-blocking I/O – do not wait slow ressources to respond • Built using V8 JavaScript Engine (from Chrome) – very fast and getting faster after each release • « Event-based » or « Asynchronous » – all execution initiated by an event – « Everything runs in parallel except your code » • Single-threaded Event Loop, limited to one CPU – no threads – no locks or no execution concurrency – events are executed in order
  • 8. What makes Node.js so popular ? • It’s fast and scalable • JavaScript all the way – Minimal learning curve – JS is now the ubiquitous language of the web – Allow code re-use between front-end and back-end. • Web centric – Being based on JS and V8, node.js naturally attracts mainly web developers • Minimalist Core API and efficient module system • Active development • Always asynchronous – All I/O done in Node is by design asynchronous • Non-fragmented community
  • 9. What makes Node.js so difficult ? Asynchronous code Single Event Loop if # entries = 10,000 doSomething() takes ~1ms you block for 10 seconds! each node process is bound to one core everything you do blocks Easy to write code like this (async may help you)
  • 11. Finally, is it good for everything ? • Good Use Case – – – – – – – JSON API Streaming Real-time Pub/Sub systems Chatty apps Dashboards Queues Proxy • Bad Use Case – CPU heavy apps – Memory intensive apps – Simple CRUD / HTML apps
  • 12. Node.js at Paypal Nov 2013, https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/ • Node.js version Vs Java – Built almost twice as fast with fewer people – Written in 33% fewer lines of code – Constructed with 40% fewer files • Node.js performance Vs Java – Double the requests per second vs. the Java application – 35% decrease in the average response time 12
  • 15. NPM : Node package manager • innovation through modularity Set of publicly available, reusable components, available through easy installation via an online repository, with version and dependency management – Preinstalled with Node.js – Approx. 50 544 online packages (Dec 2013) – +150 packages per day (#1 of all packages managers) • Features – – – – publish, install, discover, and develop node programs open to all, and anyone can publish their own module puts modules in a place where node.js can find them Manage dependencies & modules with package.json “Node.js is successful because of npm” “don’t worry about multiple versions causing conflicts because npm will automatically partition them. In other words: it just works.”
  • 16. Interesting Modules Express Underscore Commander Async Socket.IO node_redis Jade Request node-unit winston Forever node-sqlserver google-api azure-sdk Web application framework for node JavaScript's utility belt _ Complete solution for node.js command-line interfaces Higher-order functions and common patterns for asynchronous code Realtime framework, with WebSockets and cross-browser fallbacks support redis client for node Server-side templating engine Standard HTTP client Easy unit testing for node.js and the browser a multi-transport async logging library for node.js simple CLI tool for ensuring that a given script runs continuously Microsoft Driver for Node.js for SQL Server Official client library for accessing Google APIs Azure SDK for Node.js … also more than 50 000 packages
  • 17. Grunt : The Javascript Task Runner The Build Tool for JavaScript and Web Applications “Grunt is a task-based command line build tool for JavaScript projects.” Use the Power of JavaScript/Node to Automating Repetitive Tasks • Common Build Tasks (configured in gruntfile.js) – – – – – – – – – • Concatenate Compress Minify Linting (JsLint, JsHint) Testing Optimize Image Monitor Files Publish YOUR TASK HERE grunt-contrib-concat grunt-contrib-compress grunt-contrib-htmlmin, grunt-contrib-cssmin grunt-contrib-jshint , grunt-contrib-csslint grunt-contrib-qunit, grunt-contrib-nodeunit grunt-contrib-imagemin grunt-contrib-watch grunt-contrib-copy Who uses Grunt ? – Twitter, Jquery, Bootstrap, WordPress, Adobe, Pinterest, Facebook, …
  • 19. IISNode Host Node.js app in IIS • Native IIS module that allows hosting of node.js applications in IIS on Windows. – – – – – – – Node Process management Side by side with other content types. Scalability on multi-core servers Integrated debugging Auto-update Access to logs over HTTP Minimal changes to node.js application code – Integrated management experience – Other IIS benefits : Port sharing, security, URL rewriting, compression, caching, loggin g Important Node : Windows Azure Node.js hosting is powered by IISNode !
  • 20. Node.js for Visual Studio Users Node.js Tools for Visual Studio (Alpha) Turns Visual Studio into a Node.js IDE. • Editing • Intellisense • Profiling • Npm integration • Debugging locally and remotely (Windows/Mac/Linux) • Azure Deployment • … You can also try
  • 22. References • Really good introduction – http://www.nodebeginner.org/ – http://nodejs.developpez.com/tutoriels/javascript/node-js-livre-debutant/ - FRENCH- • • • • • • • • • • • http://nodejs.org/ (Official) http://nodejs.org/api/ (Official Api) http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js https://github.com/maxogden/art-of-node#the-art-of-node http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html http://package.json.nodejitsu.com/ https://blog.nodejitsu.com/npm-innovation-through-modularity https://www.paypal-engineering.com/2013/11/22/node-js-at-paypal/ http://www.youtube.com/watch?v=SAc0vQCC6UQ http://cgbystrom.com/articles/six-reasons-why-node-js-is-so-popular/ http://www.ebaytechblog.com/2013/05/17/how-we-built-ebays-first-node-jsapplication/
  • 23. Find out more • On https://techblog.betclicgroup.com/
  • 24. About Betclic • • • Betclic Everest Group, one of the world leaders in online gaming, has a unique portfolio comprising various complementary international brands: Betclic, Everest Gaming, bet-athome.com, Expekt… Active in 100 countries with more than 12 million customers worldwide, the Group is committed to promoting secure and responsible gaming and is a member of several international professional associations including the EGBA (European Gaming and Betting Association) and the ESSA (European Sports Security Association). Through our brands, Betclic Everest Group places expertise, technological know-how and security at the heart of our strategy to deliver an on-line gaming offer attuned to the passion of our players.