SlideShare uma empresa 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.

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante 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
 

Semelhante 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
 

Mais 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
 

Mais 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

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
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
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
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
 

Último (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
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!
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
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
 

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.