cloud foundry open tour beijing: becoming a node.js ninja on
 cloud foundry

Download Cloud Foundry Open Tour Beijing: Becoming a Node.js Ninja on
 Cloud Foundry

Post on 01-Sep-2014

36.001 views

Category:

Technology

4 download

Embed Size (px)

DESCRIPTION

Introduction to Node.js and how to get started with it on Cloud Foundry.

TRANSCRIPT

  • Becoming a Node.js ninja on Cloud Foundry Patrick Chanezon, Senior Director, Developer Relations chanezonp@vmware.com, @chanezon With slides from Raja Rao DV March 2012 www.cloudfoundry.com 2009 VMware Inc. All rights reservedWednesday, March 28, 12
  • P@ in a nutshell French, based in San Francisco Senior Director, Developer Relations,VMware Software Plumber, API guy, mix of Enterprise and Consumer 18 years writing software, backend guy with a taste for javascript 2 y Accenture (Notes guru), 3 y Netscape/AOL (Servers, Portals), 5 y Sun (ecommerce, blogs, Portals, feeds, open source) 6 years at Google, API guy (rst hired, helped start the team) Adwords, Checkout, Social, HTML5, CloudWednesday, March 28, 12
  • Sketching Things Slender clouds. On the pavilion a small rain. Noon, but Im too lazy to open the far cloister. I sit looking at moss so green my clothes are soaked with color. Wang Wei (699-759) 3Wednesday, March 28, 12
  • Taking a Nap by a Mountain Window Resting my body in a monks cloud chamber, my dreams relax. Pine trees and cranes rise between screen and pillow. A beautiful pheasant makes a long song. My hand pushes the window, and the mountain fill my eyes. Zhu Yunming (1461-1527) 4Wednesday, March 28, 12
  • Looking for the Hermit and Not Finding Him Beneath a pine I question a boy. He says, Master has gone to gather herbs somewhere on the mountain but who knows where? The clouds are deep. Jiao Dao (778-841) 5Wednesday, March 28, 12
  • Looking for the Hermit and Not Finding Him Lu mountain stands beside the Southern Dipper In clouds reaching silken like a nine-panelled screen With its shadows in a crystal lake deepening the green water. The Golden Gate opens into two mountain ranges. Li Bai (701-762) 6Wednesday, March 28, 12
  • Agenda 1. About Node.js Internal working of Node.js Buzz around Node.js Who is using it What kind of apps are being built 2. Coding in Node.js Sync v/s Async coding (Callbacks) Classes & Modules (CommonJS) Node.js EventEmitters npm & package.json 3. Node.js & Cloud Foundry (w/ demo) Hello World app in Cloud Foundry Using Sticky Sessions CloudFoundry Module & connecting to Redis, MongoDB etc. Express.js (RESTful) app Socket.io + Express.js (Real-time) app 4. Final demo An sample app that uses concepts & modules talked above 7Wednesday, March 28, 12
  • About Node.js Node.js is a non-blocking, event-driven I/O platform that is built on Google Chromes v8 engine. - It is ~80% C/C++ & ~20% JS (APIs) - Uses CommonJS module system. - Executes JavaScript on the server - Built by Ryan Dahl - Sponsored by Joyent Ryan Dahl (Node.js creator) 8Wednesday, March 28, 12
  • What is the biggest advantage of Node.js? Biggest thing Node.js brings to the table (other than JS) is savings in I/O cost 9Wednesday, March 28, 12
  • The cost of I/O http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/ 10Wednesday, March 28, 12
  • So how does Node.js save I/O cost? Node.js saves I/O cost by implementing Non-blocking, event driven I/O model 11Wednesday, March 28, 12
  • Event-driven, non-blocking I/O platform/server What exactly is a event-driven, non-blocking server? How is it different from a multi-threaded server? Multi-threaded blocking server v/s Event-driven, non-blocking server 12Wednesday, March 28, 12
  • Multi-threaded server - Threads are spawned for every connection DB FS Multi threaded server T Thread 13Wednesday, March 28, 12
  • Multi-threaded server - Threads are spawned for every connection User1 DB FS Multi threaded server T Thread 13Wednesday, March 28, 12
  • Multi-threaded server - Threads are spawned for every connection User1 i/o request DB FS Multi threaded server T Thread 13Wednesday, March 28, 12
  • Multi-threaded server - Threads are spawned for every connection User1 i/o request T1 DB FS Multi threaded server T Thread 13Wednesday, March 28, 12
  • Multi-threaded server - Threads are spawned for every connection User1 i/o request T1 DB Blocking FS Multi threaded server T Thread 13Wednesday, March 28, 12
  • Multi-threaded server - Threads are spawned for every connection User1 i/o request T1 DB User2 Blocking FS Multi threaded server T Thread 13Wednesday, March 28, 12
  • Multi-threaded server - Threads are spawned for every connection User1 i/o request T1 DB User2 i/o request Blocking FS Multi threaded server T Thread 13Wednesday, March 28, 12
  • Multi-threaded server - Threads are spawned for every connection User1 i/o request T1 DB User2 i/o request T2 Blocking FS Multi threaded server T Thread 13Wednesday, March 28, 12
  • Multi-threaded server - Threads are spawned for every connection User1 i/o request T1 DB User2 i/o request T2 Blocking User3 Refreshes 2 times