Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Node.js, for architects - OpenSlava 2013

13,350 views

Published on

These are the slides that were used for my presentation on Node.js in OpenSlava 2013 (October 11th, 2013, Bratislava) and provide an introduction to Node.js as well as analyze the potential effects of introducing Node.js in an enterprise and from an architectural perspective.

Published in: Technology
  • Be the first to comment

Node.js, for architects - OpenSlava 2013

  1. 1. Oscar Renalias Getting started with Node.js October 11, 2013 Organizers Top Media Partner Media Partner Supporter
  2. 2. About me @oscarrenalias github.com/oscarrenalias oscar.renalias@accenture.com oscar@renalias.net
  3. 3. Server-side
  4. 4. Javascript • Dynamically typed • Supports functions/closures • Object-oriented with prototype-based inheritance • Standardized as ECMAScript
  5. 5. V8: High Performance JavaScript Engine • JIT to native: x86, ARM and MIPS • On-the-fly recompilation of “hot” functions with an optimizing compiler • ECMAScript compliant
  6. 6. Single threaded??
  7. 7. Asynchronous, Event-based Event producers Event Event Event Callbacks
  8. 8. Single threaded, asynchronous, event-based! Wait for callback Wait for I/O Wait for I/O Callback ready
  9. 9. Event callbacks
  10. 10. Sequential callbacks?
  11. 11. So why are async and events good? • Easier to write • Scales better • Lower memory, CPU overhead
  12. 12. Rapid prototyping, rapid development
  13. 13. RESTful services with no effort
  14. 14. No-fuss, native JSON handling
  15. 15. Awesome Package management • Gets out of the way • Support for internal and public modules • Kiss problems with transitive dependencies goodbye
  16. 16. Community modules http://npmjs.org
  17. 17. Interesting Projects: Express • Minimal web application framework • Additional features are provided as modules or middleware: template engines, models, authentication and authorization, etc
  18. 18. Interesting Projects: Socket.io • Provides support for server-initiated push events using WebSockets, Ajax polling, Iframe, JSONP or Flashbased channels • Transparent for both clients and servers • Can run standalone or integrated with Express SERVER CLIENT
  19. 19. Interesting Projects: Meteor • Next-gen framework for real-time collaborative web applications • Live page updates • Support for offline databases with subsequent synchronization
  20. 20. When to use Node.js • REST+JSON APIs • Backend for single-page web apps: same language in client and server • Real-time web apps with Socket.io and Meteor • Quick prototyping • Rapidly evolving applications: media sites, marketing, etc
  21. 21. When not to use Node.js • CPU-bound tasks • Multi-threaded applications • Applications that have to process large amounts of data • Boring CRUD-type web apps
  22. 22. Ready for the Enterprise?
  23. 23. Maturity • Under development since 2008 • Node.js 1.0 around the corner • Nearly 40000 modules available via npm • Awesome community • Commercial support
  24. 24. Lightweight Architecture Enabler
  25. 25. Does it Scale?
  26. 26. Performance Test: multiple database queries per request, serialized as JSON responses
  27. 27. More Performance Test: return a response as a simple serialized JSON object Source: http://www.techempower.com/benchmarks/
  28. 28. Not the fastest; does it always matter?
  29. 29. Javascript Weird shit Like Java, with simple syntax and no types
  30. 30. JavaScript is quirky different • Prototype-based inheritance • “==“ versus “===“ • The meaning of “this” • Call, apply and bind in Function.prototype And more.
  31. 31. Solid development toolset
  32. 32. Toolset • Large selection of testing libraries: unit testing, functional testing, BDD • Static code analysis (JsHint) • IntelliJ IDEA, Eclipse (Nodeclipse) integration: highlighting, refactoring, debugging • Integration with Jenkins/Hudson, Node.js specific CI servers • NPM supports internal module repositories
  33. 33. Architects have a little bit of extra work Node.js currently lacks standards; extra effort and care must be paid to • application architecture, • development lifecycle, • code quality, And many more.
  34. 34. Big teams, big codebases
  35. 35. Where does it run?
  36. 36. Is it commercially supported? Joyent is the corporate steward of Node.js, the world’s best runtime for today's data-intensive, real-time applications. Joyent offers exclusive debugging and performance analysis tools for Node.js applications.
  37. 37. Anybody using it?

×