SlideShare a Scribd company logo
Node.js, toy or power tool?
                            Jax CodeCamp, Oct 2012

                                 Ovidiu Dimulescu




Saturday, October 6, 12
Agenda
                      •   What problem?
                      •   How’s Node.js helping?
                      •   Use cases
                      •   Industry support
                      •   Coding in Node.js
                      •   Ecosystem
                      •   Q &A




Saturday, October 6, 12
About @odimulescu
         • Working on the Web since 1997
         • Into startup and engineering cultures
         • Speaker at user groups
         • Organizer for JaxMUG.com
         • Co-Organizer for Jax Big Data meetup




Saturday, October 6, 12
Node.js - What’s the problem?
        Fast CPUs Spinning wheels




        How do we saturate the CPU doing useful work?

Saturday, October 6, 12
Node.js - How’s it helping?




                          • Uses event-driven, non-blocking IO
                          • Enforces async throughout*




Saturday, October 6, 12
Multi-Threaded Servers




       *Credit: blog.cloudfoundry.com

Saturday, October 6, 12
Node.js - Single Thread, Event-ed




       *Credit: blog.cloudfoundry.com

Saturday, October 6, 12
Node.js - Concurrency

                          Node.js Event Loop


              Rq1                              Rq1

              Rq2                              Rq2


              Green - Request Executing
              Red - IO wait


Saturday, October 6, 12
Node.js - Concurrency

                          Thread

                          Node.js

                                    Higher Concurrency
                                    Same Latency




Saturday, October 6, 12
Node.js - Been there, done that
         Event Machines
              •           - Twisted
              •           - EventMachine
              •           - Mina, Netty, Atmosphere, vertx.io
              •           - POE


         Others
              • Erlang
              • Scala / Akka



Saturday, October 6, 12
Node.js - But ...




                          They mix async with sync and the mentality is
                          towards sync in libraries, drivers etc.




Saturday, October 6, 12
Node.js - Use Cases
         • Proxy between different data layers
         • Soft real-time apps
         • Crawlers
         • CLI tools
         • Quick prototyping
         • Lower HW and Operational cost*




Saturday, October 6, 12
Node.js - Not best fit
         • Culture mismatch
         • Uses Javascript
         • Requests are CPU intensive
         • Apps relies on specific libraries / functionality
         • Transactional systems




Saturday, October 6, 12
Node.js - Industry Support




Saturday, October 6, 12
Node.js - Industry Usage




Saturday, October 6, 12
Node.js - Installation



                          1. Go to nodejs.org
                          2. Download and run installer




Saturday, October 6, 12
Node.js - Installation
         1. Go to nodejs.org
         2. Download and run installer


         What’s included?

              node - binary
              npm - cli package manager
              built-in support for http, net, dns




Saturday, October 6, 12
Node.js - Server Installation
         1. Regular Installation

         2. Make it a service
              Windows - NSSM, srvany, etc.
              Unix - Distro dependent

         3. Front-end WS Integration
              IIS 7+ Integration - iisnode
              Apache - mod_proxy or mod_rewrite
              Nginx - rewrite or proxy
              HAProxy, stunnel


Saturday, October 6, 12
Node.js -                  Considerations

         Lowest privileges
              Unix: drop to non-root via setuid / setguid
              Front with a secure Proxy


         Enable safeguards
              “use strict”




Saturday, October 6, 12
Node.js - Hello World
         CLI Version - helloworld.js
              console.log(“Hello world”);
              $ node helloworld.js
              Hello World

         Web Version




Saturday, October 6, 12
Node.js - Hello World
         Web - Router Version




Saturday, October 6, 12
Node.js - I will call you back




Saturday, October 6, 12
Node.js - When, then




Saturday, October 6, 12
Node.js - Flow libraries
         Serial independent
              Runs a series of functions one after the previous function completed

         Serial dependent
              Runs a series of functions passing previous results into next function

         Parallel fashion
              Runs a series of function in parallel

         Queue
              Runs a series of function in parallel up to desired concurrency

         Library Choices
              Async, Groupie, Step, Q, etc.


Saturday, October 6, 12
Node.js - Modules
         Module - mymodule.js




         Client mymodule_client.js




Saturday, October 6, 12
Node.js - Modules

        package.json




        require(‘mylib’) - Lookup order

               1. package.json -> ./lib/mylib.js

               2. index.js

               3. index.node




Saturday, October 6, 12
Node.js - Logging
              •     console
              •     log4js
              •     Winston
              •     GELF - Graylog Extended Log Format
              •     Windows Event Log
              ...




Saturday, October 6, 12
Node.js - Debugging
         $ npm install node-inspector
         $ node --debug-brk myapp.js
         $ node --debug myapp.js
         debugger listening on port 5858
         $ node-inspector
         visit http://0.0.0.0:8080/debug?port=5858 to start debugging


         Debuggers
              WebKit based: Chrome
              Eclipse V8 Debugger Plugin, JetBrains WebStorm


         Other Tools
              v8-profiler, node-profiler
              nodetime.com



Saturday, October 6, 12
Node.js - Inspector




Saturday, October 6, 12
Node.js - Debugging




Saturday, October 6, 12
Node.js - DB / ORM
         Database Drivers
              MS SQL, MongoDB, PostgreSQL, MySQL, Oracle, SQLite,
              Redis, CouchDB, Hive, Riak, Cassandra


         ORMs
              sequelize, persist, LazyBoy, Model, jugglingdb, node-orm


                Transactions, Connection Pooling
              node-mysql-queues




Saturday, October 6, 12
Node.js - Web frameworks
              •      Derby
              •      Express
              •      Flatiron
              •      Meteor
              •      Mojito
              •      Tower
               ...
         Browserify - Node to Browser conversion




Saturday, October 6, 12
Node.js - Testing frameworks
              •      assert - built in
              •      API Easy
              •      Cucumber
              •      httpmock, nock, mockery
              •      NodeUnit
              •      Soda
               ...




Saturday, October 6, 12
Node.js - Scaling out




Saturday, October 6, 12
Node.js - Scaling out




     *Credit: blog.evantahler.com



Saturday, October 6, 12
Node.js - Wrapping up
         • Reuse existing JavaScript skill and code
         • Low resource usage
         • Performant VM (Google’s V8)
         • Active Community, Lots of resources
         • Package Manager
         • Enforces Async across
         • Quick Prototyping
         • Growing Industry support




Saturday, October 6, 12
Q &A




Saturday, October 6, 12

More Related Content

What's hot

vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVM
jbandi
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
Dmytro Semenov
 
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Edureka!
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialTom Croucher
 
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!
 
Understanding the Single Thread Event Loop
Understanding the Single Thread Event LoopUnderstanding the Single Thread Event Loop
Understanding the Single Thread Event Loop
TorontoNodeJS
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
Colin Mackay
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
Ganesh Kondal
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
drupalcampest
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
Maciej Lasyk
 
Why Play Framework is fast
Why Play Framework is fastWhy Play Framework is fast
Why Play Framework is fast
Legacy Typesafe (now Lightbend)
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
Sascha Möllering
 
Development with Vert.x: an event-driven application framework for the JVM
Development with Vert.x: an event-driven application framework for the JVMDevelopment with Vert.x: an event-driven application framework for the JVM
Development with Vert.x: an event-driven application framework for the JVM
David Wu
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
 
Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)
Tomer Gabel
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
Kevin Webber
 
Node js internal
Node js internalNode js internal
Node js internal
Chinh Ngo Nguyen
 
Vert.x
Vert.xVert.x
Vert.x
Matt Stine
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Dinesh U
 

What's hot (20)

vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVM
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js +  Expres...
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
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 ...
 
Understanding the Single Thread Event Loop
Understanding the Single Thread Event LoopUnderstanding the Single Thread Event Loop
Understanding the Single Thread Event Loop
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
 
Why Play Framework is fast
Why Play Framework is fastWhy Play Framework is fast
Why Play Framework is fast
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
 
Development with Vert.x: an event-driven application framework for the JVM
Development with Vert.x: an event-driven application framework for the JVMDevelopment with Vert.x: an event-driven application framework for the JVM
Development with Vert.x: an event-driven application framework for the JVM
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
Node js internal
Node js internalNode js internal
Node js internal
 
Vert.x
Vert.xVert.x
Vert.x
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 

Similar to Node.js, toy or power tool?

Offience's Node showcase
Offience's Node showcaseOffience's Node showcase
Offience's Node showcase
cloud4le
 
A Journey Begin with Node.js
A Journey Begin with Node.jsA Journey Begin with Node.js
A Journey Begin with Node.js
Khalid Farhan
 
Mini-Training: Node.js
Mini-Training: Node.jsMini-Training: Node.js
Mini-Training: Node.js
Betclic Everest Group Tech Team
 
OpenSky Infrastructure
OpenSky InfrastructureOpenSky Infrastructure
OpenSky InfrastructureJonathan Wage
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.jsRichard Rodger
 
Building A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage SolutionBuilding A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage Solution
Phil Cryer
 
State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...
State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...
State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...
Alexandre Morgaut
 
Node js实践
Node js实践Node js实践
Node js实践
jay li
 
Introduction to Napa.js
Introduction to Napa.jsIntroduction to Napa.js
Introduction to Napa.js
Daiyi Peng
 
NDH2k12 Cloud Computing Security
NDH2k12 Cloud Computing SecurityNDH2k12 Cloud Computing Security
NDH2k12 Cloud Computing Security
Matthieu Bouthors
 
Distributed Fuzzing Framework Design
Distributed Fuzzing Framework DesignDistributed Fuzzing Framework Design
Distributed Fuzzing Framework Design
bannedit
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby Conference
John Woodell
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
async_io
 
Openstack In Real Life
Openstack In Real LifeOpenstack In Real Life
Openstack In Real Life
Paul Guth
 
Cloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 SlidesCloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 Slides
Ryan Koop
 
Cloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentationsCloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentations
CloudCamp Chicago
 
Apereo OAE - Architectural overview
Apereo OAE - Architectural overviewApereo OAE - Architectural overview
Apereo OAE - Architectural overview
Nicolaas Matthijs
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
JITENDRA KUMAR PATEL
 
Intro to Node.js
Intro to Node.jsIntro to Node.js
Intro to Node.js
James Carr
 

Similar to Node.js, toy or power tool? (20)

Offience's Node showcase
Offience's Node showcaseOffience's Node showcase
Offience's Node showcase
 
A Journey Begin with Node.js
A Journey Begin with Node.jsA Journey Begin with Node.js
A Journey Begin with Node.js
 
Mini-Training: Node.js
Mini-Training: Node.jsMini-Training: Node.js
Mini-Training: Node.js
 
OpenSky Infrastructure
OpenSky InfrastructureOpenSky Infrastructure
OpenSky Infrastructure
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.js
 
Building A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage SolutionBuilding A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage Solution
 
State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...
State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...
State of the art: Server-Side JavaScript - WebWorkersCamp IV - Open World For...
 
HTML5, are we there yet?
HTML5, are we there yet?HTML5, are we there yet?
HTML5, are we there yet?
 
Node js实践
Node js实践Node js实践
Node js实践
 
Introduction to Napa.js
Introduction to Napa.jsIntroduction to Napa.js
Introduction to Napa.js
 
NDH2k12 Cloud Computing Security
NDH2k12 Cloud Computing SecurityNDH2k12 Cloud Computing Security
NDH2k12 Cloud Computing Security
 
Distributed Fuzzing Framework Design
Distributed Fuzzing Framework DesignDistributed Fuzzing Framework Design
Distributed Fuzzing Framework Design
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby Conference
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Openstack In Real Life
Openstack In Real LifeOpenstack In Real Life
Openstack In Real Life
 
Cloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 SlidesCloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 Slides
 
Cloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentationsCloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentations
 
Apereo OAE - Architectural overview
Apereo OAE - Architectural overviewApereo OAE - Architectural overview
Apereo OAE - Architectural overview
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
Intro to Node.js
Intro to Node.jsIntro to Node.js
Intro to Node.js
 

More from Ovidiu Dimulescu

Microservices - Yet another buzzword
Microservices - Yet another buzzwordMicroservices - Yet another buzzword
Microservices - Yet another buzzword
Ovidiu Dimulescu
 
Journeyman to Master
Journeyman to MasterJourneyman to Master
Journeyman to Master
Ovidiu Dimulescu
 
The Rise of DevOps
The Rise of DevOpsThe Rise of DevOps
The Rise of DevOps
Ovidiu Dimulescu
 
Hadoop on Azure, Blue elephants
Hadoop on Azure,  Blue elephantsHadoop on Azure,  Blue elephants
Hadoop on Azure, Blue elephants
Ovidiu Dimulescu
 
Git for Windows
Git for WindowsGit for Windows
Git for Windows
Ovidiu Dimulescu
 
Git SVN Migrate Reasons
Git SVN Migrate ReasonsGit SVN Migrate Reasons
Git SVN Migrate Reasons
Ovidiu Dimulescu
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Ovidiu Dimulescu
 

More from Ovidiu Dimulescu (9)

Microservices - Yet another buzzword
Microservices - Yet another buzzwordMicroservices - Yet another buzzword
Microservices - Yet another buzzword
 
Journeyman to Master
Journeyman to MasterJourneyman to Master
Journeyman to Master
 
The Rise of DevOps
The Rise of DevOpsThe Rise of DevOps
The Rise of DevOps
 
Hadoop on Azure, Blue elephants
Hadoop on Azure,  Blue elephantsHadoop on Azure,  Blue elephants
Hadoop on Azure, Blue elephants
 
Git for Windows
Git for WindowsGit for Windows
Git for Windows
 
Hadoop, Taming Elephants
Hadoop, Taming ElephantsHadoop, Taming Elephants
Hadoop, Taming Elephants
 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
 
Git SVN Migrate Reasons
Git SVN Migrate ReasonsGit SVN Migrate Reasons
Git SVN Migrate Reasons
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 

Node.js, toy or power tool?

  • 1. Node.js, toy or power tool? Jax CodeCamp, Oct 2012 Ovidiu Dimulescu Saturday, October 6, 12
  • 2. Agenda • What problem? • How’s Node.js helping? • Use cases • Industry support • Coding in Node.js • Ecosystem • Q &A Saturday, October 6, 12
  • 3. About @odimulescu • Working on the Web since 1997 • Into startup and engineering cultures • Speaker at user groups • Organizer for JaxMUG.com • Co-Organizer for Jax Big Data meetup Saturday, October 6, 12
  • 4. Node.js - What’s the problem? Fast CPUs Spinning wheels How do we saturate the CPU doing useful work? Saturday, October 6, 12
  • 5. Node.js - How’s it helping? • Uses event-driven, non-blocking IO • Enforces async throughout* Saturday, October 6, 12
  • 6. Multi-Threaded Servers *Credit: blog.cloudfoundry.com Saturday, October 6, 12
  • 7. Node.js - Single Thread, Event-ed *Credit: blog.cloudfoundry.com Saturday, October 6, 12
  • 8. Node.js - Concurrency Node.js Event Loop Rq1 Rq1 Rq2 Rq2 Green - Request Executing Red - IO wait Saturday, October 6, 12
  • 9. Node.js - Concurrency Thread Node.js Higher Concurrency Same Latency Saturday, October 6, 12
  • 10. Node.js - Been there, done that Event Machines • - Twisted • - EventMachine • - Mina, Netty, Atmosphere, vertx.io • - POE Others • Erlang • Scala / Akka Saturday, October 6, 12
  • 11. Node.js - But ... They mix async with sync and the mentality is towards sync in libraries, drivers etc. Saturday, October 6, 12
  • 12. Node.js - Use Cases • Proxy between different data layers • Soft real-time apps • Crawlers • CLI tools • Quick prototyping • Lower HW and Operational cost* Saturday, October 6, 12
  • 13. Node.js - Not best fit • Culture mismatch • Uses Javascript • Requests are CPU intensive • Apps relies on specific libraries / functionality • Transactional systems Saturday, October 6, 12
  • 14. Node.js - Industry Support Saturday, October 6, 12
  • 15. Node.js - Industry Usage Saturday, October 6, 12
  • 16. Node.js - Installation 1. Go to nodejs.org 2. Download and run installer Saturday, October 6, 12
  • 17. Node.js - Installation 1. Go to nodejs.org 2. Download and run installer What’s included? node - binary npm - cli package manager built-in support for http, net, dns Saturday, October 6, 12
  • 18. Node.js - Server Installation 1. Regular Installation 2. Make it a service Windows - NSSM, srvany, etc. Unix - Distro dependent 3. Front-end WS Integration IIS 7+ Integration - iisnode Apache - mod_proxy or mod_rewrite Nginx - rewrite or proxy HAProxy, stunnel Saturday, October 6, 12
  • 19. Node.js - Considerations Lowest privileges Unix: drop to non-root via setuid / setguid Front with a secure Proxy Enable safeguards “use strict” Saturday, October 6, 12
  • 20. Node.js - Hello World CLI Version - helloworld.js console.log(“Hello world”); $ node helloworld.js Hello World Web Version Saturday, October 6, 12
  • 21. Node.js - Hello World Web - Router Version Saturday, October 6, 12
  • 22. Node.js - I will call you back Saturday, October 6, 12
  • 23. Node.js - When, then Saturday, October 6, 12
  • 24. Node.js - Flow libraries Serial independent Runs a series of functions one after the previous function completed Serial dependent Runs a series of functions passing previous results into next function Parallel fashion Runs a series of function in parallel Queue Runs a series of function in parallel up to desired concurrency Library Choices Async, Groupie, Step, Q, etc. Saturday, October 6, 12
  • 25. Node.js - Modules Module - mymodule.js Client mymodule_client.js Saturday, October 6, 12
  • 26. Node.js - Modules package.json require(‘mylib’) - Lookup order 1. package.json -> ./lib/mylib.js 2. index.js 3. index.node Saturday, October 6, 12
  • 27. Node.js - Logging • console • log4js • Winston • GELF - Graylog Extended Log Format • Windows Event Log ... Saturday, October 6, 12
  • 28. Node.js - Debugging $ npm install node-inspector $ node --debug-brk myapp.js $ node --debug myapp.js debugger listening on port 5858 $ node-inspector visit http://0.0.0.0:8080/debug?port=5858 to start debugging Debuggers WebKit based: Chrome Eclipse V8 Debugger Plugin, JetBrains WebStorm Other Tools v8-profiler, node-profiler nodetime.com Saturday, October 6, 12
  • 31. Node.js - DB / ORM Database Drivers MS SQL, MongoDB, PostgreSQL, MySQL, Oracle, SQLite, Redis, CouchDB, Hive, Riak, Cassandra ORMs sequelize, persist, LazyBoy, Model, jugglingdb, node-orm Transactions, Connection Pooling node-mysql-queues Saturday, October 6, 12
  • 32. Node.js - Web frameworks • Derby • Express • Flatiron • Meteor • Mojito • Tower ... Browserify - Node to Browser conversion Saturday, October 6, 12
  • 33. Node.js - Testing frameworks • assert - built in • API Easy • Cucumber • httpmock, nock, mockery • NodeUnit • Soda ... Saturday, October 6, 12
  • 34. Node.js - Scaling out Saturday, October 6, 12
  • 35. Node.js - Scaling out *Credit: blog.evantahler.com Saturday, October 6, 12
  • 36. Node.js - Wrapping up • Reuse existing JavaScript skill and code • Low resource usage • Performant VM (Google’s V8) • Active Community, Lots of resources • Package Manager • Enforces Async across • Quick Prototyping • Growing Industry support Saturday, October 6, 12