20120514 nodejsdublin

442 views
378 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
442
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 20120514 nodejsdublin

    1. 1. Node.jsAn Introduction Richard Rodger @rjrodger Richard Rodger @rjrodger nearform.com
    2. 2. For thenext tenyears ...
    3. 3. For thenext tenyears ... ... youll do most of your coding in JavaScript
    4. 4. What canJavaScript do for you? •dynamic language •prototypes instead of classes •functional • ... and it looks like C
    5. 5. there arethreeeras... 1990s 2000s 2010s
    6. 6. you wont get fired * yes I know about tiobe.com
    7. 7. why?
    8. 8. how manyconcurrent clients? 90s: 10 00s: 100 10s: 1000 C10K Problem
    9. 9. How doyou scale? processes threads events
    10. 10. • Runs high-performance server-side JavaScript• Uses the Google Chrome V8 engine • just-in-time compilation to machine code • generation garbage collection (like the Java JVM) • creates virtual “classes” to optimise property lookups• Has a well-designed module system for third party code - very effective and simple to use• Your code runs in a single non-blocking JavaScript thread• That’s OK, most of the time you’re waiting for database or network events
    11. 11. being event-driven is likehaving Jeeves run yourserver
    12. 12. Node.js Web Servervar http = require(http);var server = http.createServer(function (req, res) { res.writeHead(200, {Content-Type: text/plain}); res.end(Hello Worldn);})server.listen(1337, "127.0.0.1");console.log(Server running at http://127.0.0.1:1337);
    13. 13. JavaScript: an eligible bachelor? avoid slow, validate forms date ECMA, jQuery marry Node.js, Crockford
    14. 14. crockford.comfunction Y(le) { return (function (f) { return f(f); }(function (f) { return le(function (x) { return f(f)(x); }); }));}
    15. 15. Wherewill yourapp live? co-lo buy, build, and rack IaaS Amazon EC2 PaaS Heroku
    16. 16. Node.js Code Volume43210 Client JavaScript Server JavaScript
    17. 17. Node.js does what it says on the tin • High performance • callback spaghetti is not a problem in practice • High throughput • Low CPU usage • use functional style • Constant memory usage • client-side code is far more difficult • leaks will kill, but then • Dont do CPU intensive stuff • < 100ms startup time • ... theres a warning on • means you may not the tin! notice!
    18. 18. Whos using Node.js in Ireland?
    19. 19. JavaScript
    20. 20. My CompanyHTML5 Apps + Node.jsMy Bookrichardrodger.comRichard Rodger@rjrodgernearform.com

    ×