an introduction to node.js

26
Patrick Heneise @PatrickHeneise An Introduction { 9. . 2012

Upload: nodejsbcn

Post on 17-May-2015

594 views

Category:

Technology


2 download

TRANSCRIPT

Patrick Heneise@PatrickHeneise

An Introduction {9. . 2012

Server Side Software SystemYet Another Web Framework

Traditional Multithreadingwith Apache

Concurrent Connections

0

10

20

30

40

0 500 1000 1500 2000 2500 3000 3500 4000

Mem

ory

in M

B

http://blog.webfaction.com/2008/12/a-little-holiday-present-10000-reqssec-with-nginx-2/

Apache Nginx

The Pizza Example

Event Loop

JavaScript

[...] if you work on the web, love it or hate it, you’re going to have to work with JavaScript at some point.

Installation

http://nodejs.orgHit INSTALL

brew install node

Hello World!

var http = require('http');http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n');}).listen(1337, '127.0.0.1');console.log('Server running at http://127.0.0.1:1337/');

Twitter Demo

What is node.js?

Basic theory

Installation

Hello World

Twitter World

npm - the node package manager

http://npm-count.jit.suNPM Count

Number of Modulesnpm vs. gem vs. pip

0

7500

15000

22500

30000

11/09/2012

NPM Ruby Gems pip

Node Deployment

jitsu deploy

http://nodejitsu.com

Helicopters! Flying robots & node.jshttp://nodecopter.com

Extremely fast operations

V8 Runtime

Rapidly growing ecosystem

Super easy deployment, free developer services

JavaScript

Summary

Q&A

Thanks