Hungarian Webkonf: Why Node.js?

Hungarian Webkonf: Why Node.js?

My talk for the Hungarian webkonf, targeting newcomers to get a feeling of node.js and inspire them to learn it.

http://risingstack.com

29955e7f5ba4bd072e7c0e98e4a788fb?s=128

Gergely Nemeth

November 09, 2014
Tweet

Transcript

  1. Why Node.js? #webkonf Gergely Nemeth @nthgergo

  2. WHOAMI nodebp.com oneshot.risingstack.com risingstack.com

  3. JAVASCRIPT - created in 1995 - runs in every major

    browser - prototype-based, dynamic typing, first- class functions
  4. JAVASCRIPT

  5. JAVASCRIPT not just the language of the browser any more

  6. FIRST-CLASS CITIZEN IN OSX

  7. INTERNET OF THINGS

  8. IN THE CLOUD

  9. NODE.JS “for easily building fast, scalable network applications”

  10. NODE.JS - V8

  11. NODE.JS - V8 - nonblocking I/O

  12. NODE.JS Blocking I/O the traditional way Nonblocking I/O the Node.js

    way
  13. NODE.JS - V8 - nonblocking I/O - event driven

  14. NODE.JS - V8 - nonblocking I/O - event driven -

    single threaded
  15. CALLBACKS fs.readFile('/file', function(err, data) { if (err) throw err; console.log(data);

    });
  16. SOME OF THE ADOPTERS…

  17. THE PAYPAL CASE-STUDY existing Java stack

  18. THE PAYPAL CASE-STUDY Java and Node in parallel

  19. THE PAYPAL CASE-STUDY One Language to Rule them all

  20. THE PAYPAL CASE-STUDY Now all new apps at PayPal are

    written in Node.
  21. THE PAYPAL CASE-STUDY - Headcount: from ⅓ to 1/10 -

    Performance: 10x throughput in scale - Lines of code: code size shrink by factor of 3-5
  22. HOW?

  23. None
  24. NPM - open repository for Node modules - proper SemVer

    - more than 100.000 modules - open source all the things!
  25. NPM Would be nice to use all this in the

    browser as well?
  26. None
  27. BROWSERIFY - require('modules') in the browser - bundling up all

    of your dependencies from the node_modules dir - does not pollute the global scope http://blog.risingstack.com/publishing-your-first-browserify-node-module/
  28. BROWSERIFY // main.js var $ = require('jquery'); $('body').append('<p>Hello Browserify!</p>'); npm

    install jquery --save browserify main.js -o bundle.js
  29. Which brings us to...

  30. ISOMORPHIC JAVASCRIPT http://blog.risingstack.com/from-angularjs-to-react-the-isomorphic-way/

  31. Thanks! Gergely Nemeth @nthgergo