6. What’s NodeJS? NewsCred
NodeJS
What’s this all about?
Saturday, September 17, 2011
7. What’s NodeJS? NewsCred
NodeJS
Evented I/O for V8 JavaScript.
Saturday, September 17, 2011
8. What’s NodeJS? NewsCred
Goal
“Provide an easy way to build scalable
network programs.”
Saturday, September 17, 2011
9. History NewsCred
The Evolution of the Web
From static pages to real time data.
Saturday, September 17, 2011
10. Why NodeJS? NewsCred
The Age of Big Data
Exabytes (1018) of data stored per year
1000
750
500
250
2006
2007
2008 0
2009
2010
Saturday, September 17, 2011
11. Why NodeJS? NewsCred
The Fast Food Analogy
Synchronous vs. Asynchronous
Saturday, September 17, 2011
12. Why NodeJS? NewsCred
The Apache Solution
Synchronous I/O
Application
File
User readFile(); System
getTweets(); Twitter
API
writeToDb(); MySQL
Saturday, September 17, 2011
13. Why NodeJS? NewsCred
The Apache Solution
Blocking I/O
Application
File
User readFile(); System
Waiting...
getTweets(); Twitter
API
Waiting...
writeToDb(); MySQL
Saturday, September 17, 2011
14. Why NodeJS? NewsCred
The NodeJS Solution
Asynchronous I/O
Application
File
User readFile(); System
getTweets(); Twitter
API
writeToDb(); MySQL
Saturday, September 17, 2011
15. Why NodeJS? NewsCred
The NodeJS Solution
Non-blocking I/O
Application
File
User readFile(); System
getTweets(); Twitter
API
writeToDb(); MySQL
Saturday, September 17, 2011
16. NodeJS Benefits NewsCred
• Fast
• Built on top of Google’s V8 JavaScript engine.
• Scalable
• Asynchronous, event-driven I/O model yields web scale.
• Programmable
• JavaScript API and pluggable module architecture.
Saturday, September 17, 2011
17. NodeJS Use Cases NewsCred
• Serving APIs
• Serving real-time apps
• Serving web apps
• Streaming data
Saturday, September 17, 2011
20. Installing NodeJS NewsCred
• Installing on Unix
• Installing on Windows
• Run http://nodejs.org/dist/v0.5.6/node.exe
Saturday, September 17, 2011
21. Installing npm NewsCred
• Node Package Manager (npm)
• One line install:
• curl http://npmjs.org/install.sh | sudo sh
• Multi-line install:
• Get the code from http://github.com/isaacs/npm
• Do what the REAMME says
Saturday, September 17, 2011
22. Part 2
ExpressJS
NewsCred
Saturday, September 17, 2011
23. What’s ExpressJS? NewsCred
ExpressJS
High-performance NodeJS
web framework.
Saturday, September 17, 2011
24. Why ExpressJS? NewsCred
• Full blown feature set
• Routing
• View rendering/templating
• Sessions
• Good documentation
• Lots of examples
• Many extensions
Saturday, September 17, 2011