際際滷

際際滷Share a Scribd company logo
Welcome to Lunch and Learn
Node.js: 1
Problem 1
Problem 2
 Opinionated(Rails) Vs Non-opinionated(Node)
 Ill be opinionated too in this session.
What to expect today
 Why not Node.js
 Node.js keywords and what they mean
 Understanding the event loop
Why not Node.js?
 https://www.youtube.com/watch?v=bzkRVzci
AZg
Node.js keywords
 Developers nirvana
 Single core
 V8 JavaScript engine
 Event based and Asynchronous/Non-blocking
Developers nirvana
 It doesnt come by simply using JavaScript.
This reduces the barrier but It has to be
acquired.
 Use the right tool for the right job
Single core
 Threads are hard. Very very hard.
 Take advantage of my 16 core box:
 Multiple node js servers (one per core)
 Fire up child processes
V8 JavaScript engine
 Developed by Google and is open source
 It's no longer a JavaScript "interpreter" as all
the modern engines do tons of JIT compiling
under the hood with interpretation only as a
fallback for execute-once code.
 Microsoft forked nodejs for chakra as well.
Event based and Asynchronous/Non-blocking
 NodeJS is bad ass manager
 Give task to its subordinates and goes to sleep.
 Wakes up only if new request comes in or its
subordinates complete the tasks.
Understanding event loop
 Everything runs in parallel except your code.
Understanding event loop
We have already used event loop
 element.onclick()
 AJAX
Node.js within MDL
 Seneca
 groki-server

More Related Content

Intro to nodejs

  • 1. Welcome to Lunch and Learn Node.js: 1
  • 3. Problem 2 Opinionated(Rails) Vs Non-opinionated(Node) Ill be opinionated too in this session.
  • 4. What to expect today Why not Node.js Node.js keywords and what they mean Understanding the event loop
  • 5. Why not Node.js? https://www.youtube.com/watch?v=bzkRVzci AZg
  • 6. Node.js keywords Developers nirvana Single core V8 JavaScript engine Event based and Asynchronous/Non-blocking
  • 7. Developers nirvana It doesnt come by simply using JavaScript. This reduces the barrier but It has to be acquired. Use the right tool for the right job
  • 8. Single core Threads are hard. Very very hard. Take advantage of my 16 core box: Multiple node js servers (one per core) Fire up child processes
  • 9. V8 JavaScript engine Developed by Google and is open source It's no longer a JavaScript "interpreter" as all the modern engines do tons of JIT compiling under the hood with interpretation only as a fallback for execute-once code. Microsoft forked nodejs for chakra as well.
  • 10. Event based and Asynchronous/Non-blocking NodeJS is bad ass manager Give task to its subordinates and goes to sleep. Wakes up only if new request comes in or its subordinates complete the tasks.
  • 11. Understanding event loop Everything runs in parallel except your code.
  • 13. We have already used event loop element.onclick() AJAX
  • 14. Node.js within MDL Seneca groki-server