63
Realtime Web Applications

BrazilJS - Node.JS Realtime Web Applications

Embed Size (px)

DESCRIPTION

Palestra sobre aplicações em tempo real no BrazilJS - Conferência Brasileira sobre Javascript.

Citation preview

Page 1: BrazilJS - Node.JS Realtime Web Applications

Realtime Web Applications

Page 2: BrazilJS - Node.JS Realtime Web Applications

#whoami

Page 3: BrazilJS - Node.JS Realtime Web Applications
Page 4: BrazilJS - Node.JS Realtime Web Applications
Page 5: BrazilJS - Node.JS Realtime Web Applications

#conceitos

Page 6: BrazilJS - Node.JS Realtime Web Applications

The real-time web is a set of technologies and practices that

enable users to receive information as soon as it is published by its

authors, rather than requiring that they or their software check a source

periodically for updates.

Page 7: BrazilJS - Node.JS Realtime Web Applications

The real-time web is a set of technologies and practices that

enable users to receive information as soon as it is published by its

authors, rather than requiring that they or their software check a source

periodically for updates.

Page 8: BrazilJS - Node.JS Realtime Web Applications

#AjaxPooling

Page 9: BrazilJS - Node.JS Realtime Web Applications

#FirstTry

Page 10: BrazilJS - Node.JS Realtime Web Applications

#FirstTry

Page 11: BrazilJS - Node.JS Realtime Web Applications

#FirstTry #SecondTry

Page 12: BrazilJS - Node.JS Realtime Web Applications

#FirstTry #SecondTry

Page 13: BrazilJS - Node.JS Realtime Web Applications

#Success

Page 14: BrazilJS - Node.JS Realtime Web Applications

#Success

Page 15: BrazilJS - Node.JS Realtime Web Applications

#AjaxPooling

Page 16: BrazilJS - Node.JS Realtime Web Applications

#LongPooling

Page 17: BrazilJS - Node.JS Realtime Web Applications

#Realtime

Page 18: BrazilJS - Node.JS Realtime Web Applications
Page 19: BrazilJS - Node.JS Realtime Web Applications
Page 20: BrazilJS - Node.JS Realtime Web Applications

Realtime na prática

Page 21: BrazilJS - Node.JS Realtime Web Applications

Realtime!=

Ajax

Page 22: BrazilJS - Node.JS Realtime Web Applications

#exemplos

Page 23: BrazilJS - Node.JS Realtime Web Applications
Page 24: BrazilJS - Node.JS Realtime Web Applications
Page 25: BrazilJS - Node.JS Realtime Web Applications
Page 26: BrazilJS - Node.JS Realtime Web Applications
Page 27: BrazilJS - Node.JS Realtime Web Applications
Page 28: BrazilJS - Node.JS Realtime Web Applications
Page 29: BrazilJS - Node.JS Realtime Web Applications
Page 30: BrazilJS - Node.JS Realtime Web Applications
Page 31: BrazilJS - Node.JS Realtime Web Applications

#ComoFaz

Page 32: BrazilJS - Node.JS Realtime Web Applications

Comet

Page 33: BrazilJS - Node.JS Realtime Web Applications

HTTP Server Push

Comet

Page 34: BrazilJS - Node.JS Realtime Web Applications

HTTP Server Push Reverse Ajax

Comet

Page 35: BrazilJS - Node.JS Realtime Web Applications

HTTP Server Push

HTTP Streaming

Reverse Ajax

Comet

Page 36: BrazilJS - Node.JS Realtime Web Applications

HTTP Server Push

HTTP Streaming

Reverse Ajax

Comet

Log Pooling

Page 37: BrazilJS - Node.JS Realtime Web Applications

Comet é um saco de gato. Se refere a todas

as tentativas deRealtime Web

Page 38: BrazilJS - Node.JS Realtime Web Applications
Page 39: BrazilJS - Node.JS Realtime Web Applications

A idéia de fazer Realtime Web não é

nova

Page 40: BrazilJS - Node.JS Realtime Web Applications

Content-type: multipart/x-mixed-replace; boundary=separador

XMLHttpRequest multipart = true

Netscape 1995

Page 41: BrazilJS - Node.JS Realtime Web Applications

Content-type: multipart/x-mixed-replace; boundary=separador

XMLHttpRequest multipart = true

Netscape 1995

#IEFail

Page 42: BrazilJS - Node.JS Realtime Web Applications

#Alternativa

Page 43: BrazilJS - Node.JS Realtime Web Applications

Forever Iframe

Page 44: BrazilJS - Node.JS Realtime Web Applications

Forever Iframe

Connection: keep-alive

Transfer-Encoding: chunked

Page 45: BrazilJS - Node.JS Realtime Web Applications

Forever Iframe

#SpinnerFail#DelinitadorFail

Connection: keep-alive

Transfer-Encoding: chunked

Page 46: BrazilJS - Node.JS Realtime Web Applications

Gambiarras para todo lado. A web não foi

feita inicialmente para Realtime

Page 47: BrazilJS - Node.JS Realtime Web Applications

Sockets

Page 48: BrazilJS - Node.JS Realtime Web Applications

Websocket

Sockets

Page 49: BrazilJS - Node.JS Realtime Web Applications

Websocket

FlashSocket

Sockets

Page 50: BrazilJS - Node.JS Realtime Web Applications

Websocket e FlashSocket são uma espécie de

TCP para Web

Page 51: BrazilJS - Node.JS Realtime Web Applications

Websocket

Page 52: BrazilJS - Node.JS Realtime Web Applications

WebsocketFaz parte da

especificação HTML5

Page 53: BrazilJS - Node.JS Realtime Web Applications

WebsocketFaz parte da

especificação HTML5

É a solução ideal para o problema

Page 54: BrazilJS - Node.JS Realtime Web Applications

WebsocketFaz parte da

especificação HTML5

É a solução ideal para o problema

Suportado por poucos browsers

Page 55: BrazilJS - Node.JS Realtime Web Applications

FlashSocket

Page 56: BrazilJS - Node.JS Realtime Web Applications

FlashSocketFaz a mesma coisa que o Websocket

Page 57: BrazilJS - Node.JS Realtime Web Applications

FlashSocketFaz a mesma coisa que o Websocket

99% dos computadores tem flash

Page 58: BrazilJS - Node.JS Realtime Web Applications

FlashSocketFaz a mesma coisa que o Websocket

99% dos computadores tem flash

Mais lento para estabelecer a conexão

Page 59: BrazilJS - Node.JS Realtime Web Applications

Não é qualquer servidor que aguenta fazer

Realtime Web

Page 60: BrazilJS - Node.JS Realtime Web Applications

Uma das opções para Realtime

Page 61: BrazilJS - Node.JS Realtime Web Applications

#LIVE

Page 62: BrazilJS - Node.JS Realtime Web Applications
Page 63: BrazilJS - Node.JS Realtime Web Applications

Obrigado !!!

Emerson Macedo@emerleite

http://nodecasts.orghttp://codificando.com