nodejs

14
 Kishore Yekkanti Thoughtworks Ryan Dahl

Upload: kishore-yekkanti

Post on 05-Jul-2015

1.690 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Nodejs

  

Kishore Yekkanti

Thoughtworks

Ryan Dahl

Page 2: Nodejs

  

What ?

Page 3: Nodejs

  

Why ?

Page 4: Nodejs

  

I/O needs to be done differently

var  result  = db.query(”select * from T”);

// use result

What is software doing while it queries the database

Page 5: Nodejs

  

db.query("select..", function (result) {

       // use result

});

Page 6: Nodejs

  

100 concurrent clients1 MB response

node       822  req/sec nginx     708 thin        85 mongrel  4

Page 7: Nodejs

  

Ingredients

Page 8: Nodejs

  

Who ?

Page 9: Nodejs

  

Design Goals No function should directly peform I/O. To receive info from disk, network or another 

process there must be a callback. Stream every thing, never force buffering of data. Have built in support for the most important 

protocols (TCP, DNS, HTTP). Chunked requests and responses Keep – alive Should be familiar to client­side JS programmers 

and old school UNIX hackers.

Page 10: Nodejs

  

How ?

Page 11: Nodejs

  

Install

$ git clone git://github.com/ry/node.git

$ cd node

$ ./configure

$ make install

Page 12: Nodejs

  

Enough Is Enough !!

Page 13: Nodejs

  

Quake Stats

Quake Server (hosted through sinatra).

Node server Node Client (Browser)

Faye (websocket server)

Node-static (to server static pages)

Page 14: Nodejs

  

kishoreyekkantikishoreyekkanti

kishoreyekkanti.blogspot.com

Questions ?