8
Building real-time apps with node.js, socket.io and knockout.js Iván Loire twitter: @ivanloire email: [email protected] Friday, March 9, 2012

Building realtime web apps using node.js, socket.io and knockout.js

Embed Size (px)

DESCRIPTION

Building realtime web apps using node.js, socket.io and knockout.js

Citation preview

Page 1: Building realtime web apps using node.js, socket.io and knockout.js

Building real-time apps with node.js, socket.io

and knockout.js

Iván Loire

twitter: @ivanloire

email: [email protected]

Friday, March 9, 2012

Page 2: Building realtime web apps using node.js, socket.io and knockout.js

node.js

high performance javascript library for intensive I/O operations. (like HTTP)

single threaded, event oriented.

built on Chrome’s Javascript runtime (V8)

lightweight, efficient, really fast.

.. insanely fast.

Friday, March 9, 2012

Page 3: Building realtime web apps using node.js, socket.io and knockout.js

websockets

bi-directional, full duplex over a single tcp socket.

connection remains open = no tcp handshake

lightweight protocol = no http headers, 2 byte overhead

supported chrome 16, FF 11, IE 10, Opera 10

reducing latency from 150 (http) to 50 ms (sockets)

Friday, March 9, 2012

Page 4: Building realtime web apps using node.js, socket.io and knockout.js

socket.iowebsockets for the rest of us.

fallback transports (yes, it also works in IE!!)

websockets

flash sockets

ajax long polling

ajax streaming

iframe

json polling..

Friday, March 9, 2012

Page 5: Building realtime web apps using node.js, socket.io and knockout.js

knockout.js

rich, responsive display with a clean underlying data model.

declarative bindinds

automatic UI refresh

dependency tracking

templating

Friday, March 9, 2012

Page 6: Building realtime web apps using node.js, socket.io and knockout.js

... and a fast database!

open source, high performance, in-memory, key-value data store

support master-slave replication

really fast!

if durability is not needed... insanely fast!

Friday, March 9, 2012

Page 7: Building realtime web apps using node.js, socket.io and knockout.js

real-time apps web

node.js + redis + socket.io + knockout.js

real-time... or close enough?

Friday, March 9, 2012

Page 8: Building realtime web apps using node.js, socket.io and knockout.js

now let’s build a really simple real-time game...

https://github.com/iloire/math-race

thanks to @gimenete for getting me into node.js!... and thanks to @jmendiara for the node.js sticker!

Friday, March 9, 2012