rubymasters 2011 - beyond ruby with nodejs

238
Beyond With

Upload: emerson-macedo

Post on 17-Dec-2014

4.258 views

Category:

Technology


2 download

DESCRIPTION

Palestra online feita na RubyMasters Conf 2011

TRANSCRIPT

Page 1: RubyMasters 2011 - Beyond Ruby with NodeJS

Beyond

With

Page 2: RubyMasters 2011 - Beyond Ruby with NodeJS

#whoami

Page 3: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 4: RubyMasters 2011 - Beyond Ruby with NodeJS

#ruby

Page 5: RubyMasters 2011 - Beyond Ruby with NodeJS

IRuby

Page 6: RubyMasters 2011 - Beyond Ruby with NodeJS

class Product < ActiveRecord::Base

after_create :set_initial_inventory

has_many :variants, :dependent => :destroy

has_many :images, :as => :viewable, :order => :position,

:dependent => :destroy

has_many :properties, :through => :product_properties

belongs_to :tax_category

validates_presence_of :name

validates_presence_of :master_price

validates_presence_of :description

make_permalink :with => :name, :field => :permalink

end

Model

Friday, August 7, 2009

Page 7: RubyMasters 2011 - Beyond Ruby with NodeJS

“Tornar as coisas simples fáceis e as

coisas difíceis possíveis”

Fisolofia Ruby

Page 8: RubyMasters 2011 - Beyond Ruby with NodeJS

Código Bonito

Page 9: RubyMasters 2011 - Beyond Ruby with NodeJS

Código Bonito

Don’t Repeat Yourself

Page 10: RubyMasters 2011 - Beyond Ruby with NodeJS

Código Bonito

Don’t Repeat Yourself

Convention Over Configuration

Page 11: RubyMasters 2011 - Beyond Ruby with NodeJS

class Booking < ActiveRecord::Base

belongs_to :hotel

belongs_to :user

validates_presence_of :hotel

validates_presence_of :user

validates_presence_of :credit_card

validates_presence_of :credit_card_name

validates_length_of :credit_card, :within => 16..16

validates_format_of :credit_card, :with => /^\\d*$/

validates_length_of :credit_card_name, :within => 3..70

def total

hotel.price * nights

end

def nights

((checkout_date - checkin_date) / 1.day).round

end

def to_s

"Booking(#{user},#{hotel})"

end

end

Friday, August 7, 2009

Page 12: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 13: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 14: RubyMasters 2011 - Beyond Ruby with NodeJS

#números

Page 15: RubyMasters 2011 - Beyond Ruby with NodeJS

2010

Page 16: RubyMasters 2011 - Beyond Ruby with NodeJS

~ 2 bilhões de usuários de internet

em todo mundo

Page 17: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 18: RubyMasters 2011 - Beyond Ruby with NodeJS

68 milhões de usuários

Page 19: RubyMasters 2011 - Beyond Ruby with NodeJS

68 milhões de usuários

37 milhões são ativos

Page 20: RubyMasters 2011 - Beyond Ruby with NodeJS

0

500

1000

1500

2000

2000 2010

2.000 milhões

360 milhões

Usuários de Internet no Mundo (em milhões)

Page 21: RubyMasters 2011 - Beyond Ruby with NodeJS

0

17,5

35

52,5

70

2000 2010

70 milhões

10 milhões

Usuários de Internet no Brasil (em milhões)

Page 22: RubyMasters 2011 - Beyond Ruby with NodeJS

0

22,5

45

67,5

90

Brasil Italia Espanha Japão EUA Inglaterra França AustráliaAlemanha Suiça

59 %63 %

72 %73 %74 %74 %75 %77 %78 %

86 %

% de usuários ativos nas Redes Sociais

Fonte: The Nielsen Company

Page 23: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 24: RubyMasters 2011 - Beyond Ruby with NodeJS

2014

Page 25: RubyMasters 2011 - Beyond Ruby with NodeJS

~ 70% dos adultos serão usuários regulares de redes sociais

Page 26: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 27: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 28: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 29: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 30: RubyMasters 2011 - Beyond Ruby with NodeJS

Estrutura física de servidores para escalar

Page 31: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando na vertical

Page 32: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando na vertical

Page 33: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando na horizontal

Page 34: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando na horizontal

Page 35: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando na horizontal

Page 36: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando na horizontal

Page 37: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 38: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando DB na horizontal

write

read

write write

read

Page 39: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando DB na horizontal

ShardDatabase

ShardDatabase

ShardDatabase

ShardDatabase

ShardDatabase

ShardDatabase

Page 40: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 41: RubyMasters 2011 - Beyond Ruby with NodeJS

Arquitetura pra fazer o software escalar

Page 42: RubyMasters 2011 - Beyond Ruby with NodeJS

Pattern para atender muitos requests

Page 43: RubyMasters 2011 - Beyond Ruby with NodeJS

Pattern para atender muitos requests

Finalize a requisição o mais rápido possível

Page 44: RubyMasters 2011 - Beyond Ruby with NodeJS

HTTP GET

Page 45: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 46: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 47: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 48: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 49: RubyMasters 2011 - Beyond Ruby with NodeJS

HTTP POST

Page 50: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 51: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 52: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 53: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 54: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 55: RubyMasters 2011 - Beyond Ruby with NodeJS

Por que então mais uma tecnologia ?

Page 56: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 57: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando na horizontal

Page 58: RubyMasters 2011 - Beyond Ruby with NodeJS

Escalando na horizontal

Page 59: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 60: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 61: RubyMasters 2011 - Beyond Ruby with NodeJS

Qual é o problema das tecnologias atuais ?

Page 62: RubyMasters 2011 - Beyond Ruby with NodeJS

Como manter conectados 10, 20 ou

30 mil usuários simultâneos ?

Page 63: RubyMasters 2011 - Beyond Ruby with NodeJS

Nosso código costuma ser escrito assim

Page 64: RubyMasters 2011 - Beyond Ruby with NodeJS

Nosso código costuma ser escrito assim

O que o software está fazendo enquanto a querie executa ?

Page 65: RubyMasters 2011 - Beyond Ruby with NodeJS

Na maioria dos casos está travado esperando

a resposta

Page 66: RubyMasters 2011 - Beyond Ruby with NodeJS

Ruby on Rails

HTTPD Database

Page 67: RubyMasters 2011 - Beyond Ruby with NodeJS

Ruby on Rails

HTTPD Database

Page 68: RubyMasters 2011 - Beyond Ruby with NodeJS

Ruby on Rails

HTTPD Database

Page 69: RubyMasters 2011 - Beyond Ruby with NodeJS

Ruby on Rails

HTTPD

RUBYPROCESS

Database

Page 70: RubyMasters 2011 - Beyond Ruby with NodeJS

Ruby on Rails

HTTPD

RUBYPROCESS

Database

BLOCK

Page 71: RubyMasters 2011 - Beyond Ruby with NodeJS

Ruby on Rails

HTTPD

RUBYPROCESS

RUBYPROCESS

RUBYPROCESS

EUBYPROCESS

Database

BLOCK

BLOCK

BLOCK

BLOCK

Page 72: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 73: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 74: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 75: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 76: RubyMasters 2011 - Beyond Ruby with NodeJS

Java

HTTPD Database

Servlet Container

Servlet

Page 77: RubyMasters 2011 - Beyond Ruby with NodeJS

Java

HTTPD Database

Servlet Container

Servlet

Page 78: RubyMasters 2011 - Beyond Ruby with NodeJS

Java

HTTPD Database

Servlet Container

Servlet

Page 79: RubyMasters 2011 - Beyond Ruby with NodeJS

Java

HTTPD Database

Servlet ContainerThread

Servlet

Page 80: RubyMasters 2011 - Beyond Ruby with NodeJS

Java

HTTPD Database

Servlet ContainerThread

Servlet

BLOCK

Page 81: RubyMasters 2011 - Beyond Ruby with NodeJS

Java

HTTPD Database

Servlet ContainerThread

Thread

Thread

Thread

Thread

Thread

Thread

Servlet

BLOCK

BLOCK

BLOCK

BLOCK

BLOCK

BLOCK

BLOCK

Page 82: RubyMasters 2011 - Beyond Ruby with NodeJS

Apenas um processo abrindo uma thread para cada request

Page 83: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 84: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 85: RubyMasters 2011 - Beyond Ruby with NodeJS

Produtividade do programador mais que

performance da tecnologia

Page 86: RubyMasters 2011 - Beyond Ruby with NodeJS

Apenas um processo abrindo uma thread para cada request

Page 87: RubyMasters 2011 - Beyond Ruby with NodeJS

Parece bom mas ...

Page 88: RubyMasters 2011 - Beyond Ruby with NodeJS

Como manter conectados 10, 20 ou

30 mil usuários simultâneos ?

Page 89: RubyMasters 2011 - Beyond Ruby with NodeJS

Como manter conectados 10, 20 ou

30 mil usuários simultâneos ?

30 mil threads ?

Page 90: RubyMasters 2011 - Beyond Ruby with NodeJS

Apache vs NGINXconcurrency × reqs/sec

http://blog.webfaction.com/a-little-holiday-present

Apache vs NGINXconcurrency × reqs/sec

http://blog.webfaction.com/a-little-holiday-present

Page 91: RubyMasters 2011 - Beyond Ruby with NodeJS

Apache vs NGINXconcurrency × memory

http://blog.webfaction.com/a-little-holiday-present

Apache vs NGINXconcurrency × reqs/sec

http://blog.webfaction.com/a-little-holiday-present

Page 92: RubyMasters 2011 - Beyond Ruby with NodeJS

Apache cria uma thread por request

Page 93: RubyMasters 2011 - Beyond Ruby with NodeJS

Troca de contexto entre theads tem

um custo

Page 94: RubyMasters 2011 - Beyond Ruby with NodeJS

Cada OS Thread cria uma pilha de execução nova

Page 95: RubyMasters 2011 - Beyond Ruby with NodeJS

Pense bem antes de usar uma thread por

request quando precisar suportar alta

concorrência

Page 96: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 97: RubyMasters 2011 - Beyond Ruby with NodeJS

Pattern para atender muitos requests

Finalize a requisição o mais rápido possível

Page 98: RubyMasters 2011 - Beyond Ruby with NodeJS

Pattern para atender alta concorrência

Page 99: RubyMasters 2011 - Beyond Ruby with NodeJS

Pattern para atender alta concorrência

Evite threads

Page 100: RubyMasters 2011 - Beyond Ruby with NodeJS

Pattern para atender alta concorrência

Evite threads

Use um Event Loop

Page 101: RubyMasters 2011 - Beyond Ruby with NodeJS

Performance!=

Escalabilidade

Page 102: RubyMasters 2011 - Beyond Ruby with NodeJS

Performance!=

Escalabilidade

mas ...

Page 103: RubyMasters 2011 - Beyond Ruby with NodeJS

Uma performance melhor ajuda a escalar com menos recursos

Page 104: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 105: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 106: RubyMasters 2011 - Beyond Ruby with NodeJS

Precisamos fazer I/O de outra maneira

Page 107: RubyMasters 2011 - Beyond Ruby with NodeJS

Latência de I/O

Page 108: RubyMasters 2011 - Beyond Ruby with NodeJS

L1 3 ciclos

Latência de I/O

Page 109: RubyMasters 2011 - Beyond Ruby with NodeJS

L1 3 ciclos

L2 14 ciclos

Latência de I/O

Page 110: RubyMasters 2011 - Beyond Ruby with NodeJS

L1 3 ciclos

L2 14 ciclos

RAM 250 ciclos

Latência de I/O

Page 111: RubyMasters 2011 - Beyond Ruby with NodeJS

L1 3 ciclos

L2 14 ciclos

RAM 250 ciclos

Disco 41.000.000 ciclos

Latência de I/O

Page 112: RubyMasters 2011 - Beyond Ruby with NodeJS

L1 3 ciclos

L2 14 ciclos

RAM 250 ciclos

Disco 41.000.000 ciclos

Rede 240.000.000 ciclos

Latência de I/O

Page 113: RubyMasters 2011 - Beyond Ruby with NodeJS

L1 3 ciclos

L2 14 ciclos

RAM 250 ciclos

Disco 41.000.000 ciclos

Rede 240.000.000 ciclos

Latência de I/O

Page 114: RubyMasters 2011 - Beyond Ruby with NodeJS

I/O não bloqueante

Page 115: RubyMasters 2011 - Beyond Ruby with NodeJS

L1 3 ciclos

L2 14 ciclos

RAM 250 ciclos

I/O não bloqueante

Page 116: RubyMasters 2011 - Beyond Ruby with NodeJS

L1 3 ciclos

L2 14 ciclos

RAM 250 ciclos

I/O não bloqueante

I/O bloqueante

Page 117: RubyMasters 2011 - Beyond Ruby with NodeJS

L1 3 ciclos

L2 14 ciclos

RAM 250 ciclos

Disco 41.000.000 ciclos

Rede 240.000.000 ciclos

I/O não bloqueante

I/O bloqueante

Page 118: RubyMasters 2011 - Beyond Ruby with NodeJS

Infraestrutura não bloqueante, puramente baseada em eventos, para desenvolver

software de alta concorrência

Page 119: RubyMasters 2011 - Beyond Ruby with NodeJS

Servidor TCP simples em NodeJS

O código acima faz com que a execução retorne imediatamente ao event loop

Page 120: RubyMasters 2011 - Beyond Ruby with NodeJS

Por que já não faziamos dessa forma ?

Page 121: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 122: RubyMasters 2011 - Beyond Ruby with NodeJS

POSIX Assync I/O não suportado por todos

os S.Os

Page 123: RubyMasters 2011 - Beyond Ruby with NodeJS

POSIX Assync I/O não suportado por todos

os S.Os

libmysql_client não permite query async

Page 124: RubyMasters 2011 - Beyond Ruby with NodeJS

Filosofia do NodeJS

Page 125: RubyMasters 2011 - Beyond Ruby with NodeJS

Filosofia do NodeJS

Todo I/O deveria ser feito desta forma

Page 126: RubyMasters 2011 - Beyond Ruby with NodeJS

Arquitetura

eventloop

(libev)

threadpool

(libeio)

V8

Node Bindings

Node standard libraryJavascript

C

Page 127: RubyMasters 2011 - Beyond Ruby with NodeJS

#reactor

Page 128: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 129: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

Pilha de execução

I/O em disco (bloqueante)

Page 130: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(1)

Pilha de execução

I/O em disco (bloqueante)

Page 131: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(1)

http_parse(1)

Pilha de execução

I/O em disco (bloqueante)

Page 132: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(1)

http_parse(1)

Pilha de execução

load(“index.html”)

I/O em disco (bloqueante)

Page 133: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(1)

http_parse(1)

Pilha de execução

I/O em disco (bloqueante)

Page 134: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(1)

Pilha de execução

I/O em disco (bloqueante)

Page 135: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

Pilha de execução

I/O em disco (bloqueante)

Page 136: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

Pilha de execução

I/O em RAM (não bloqueante)

Page 137: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(2)

Pilha de execução

I/O em RAM (não bloqueante)

Page 138: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(2)

http_parse(2)

Pilha de execução

I/O em RAM (não bloqueante)

Page 139: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(2)

http_parse(2)

Pilha de execução

http_respond(2)

I/O em RAM (não bloqueante)

Page 140: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(2)

http_parse(2)

Pilha de execução

I/O em RAM (não bloqueante)

Page 141: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

socket_readdable(2)

Pilha de execução

I/O em RAM (não bloqueante)

Page 142: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

Pilha de execução

I/O em RAM (não bloqueante)

Page 143: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

Pilha de execução

Arquivo carregou do disco

Page 144: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

file_loaded()

Pilha de execução

Arquivo carregou do disco

Page 145: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

file_loaded()

http_respond(1)

Pilha de execução

Arquivo carregou do disco

Page 146: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

file_loaded()

Pilha de execução

Arquivo carregou do disco

Page 147: RubyMasters 2011 - Beyond Ruby with NodeJS

ev_loop()

Pilha de execução

Arquivo carregou do disco

Page 148: RubyMasters 2011 - Beyond Ruby with NodeJS

Arquitetura Web

Page 149: RubyMasters 2011 - Beyond Ruby with NodeJS

Arquitetura Web

Nginx

Page 150: RubyMasters 2011 - Beyond Ruby with NodeJS

Arquitetura Web

Rubyon

Rails

Rubyon

Rails

Rubyon

Rails

Rubyon

Rails

Rubyon

Rails

Nginx

Page 151: RubyMasters 2011 - Beyond Ruby with NodeJS

Arquitetura Web

Rubyon

Rails

Rubyon

Rails

Rubyon

Rails

Rubyon

Rails

Rubyon

Rails

Nginx

NodeJS

Page 152: RubyMasters 2011 - Beyond Ruby with NodeJS

Arquitetura Web

Nginx

Page 153: RubyMasters 2011 - Beyond Ruby with NodeJS

Arquitetura Web

Nginx

NodeJS

Page 154: RubyMasters 2011 - Beyond Ruby with NodeJS

Arquitetura Web

NodeJS

Page 155: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 156: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 157: RubyMasters 2011 - Beyond Ruby with NodeJS

#bizarrices

Page 158: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 159: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 160: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 161: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 162: RubyMasters 2011 - Beyond Ruby with NodeJS

Isso é bonito?

Page 163: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 164: RubyMasters 2011 - Beyond Ruby with NodeJS

em-syslog

Page 165: RubyMasters 2011 - Beyond Ruby with NodeJS

em-spec

em-dns

em-syslog

Page 166: RubyMasters 2011 - Beyond Ruby with NodeJS

em-proxy

em-spec

em-dns

em-syslog

em-ruby-irc

em-memcache-client

Page 167: RubyMasters 2011 - Beyond Ruby with NodeJS

em-mysql

em-proxy

em-syncrony

em-spec

em-dns

em-syslog

em-ruby-irc

em-mongo

em-memcache-client em-simplechat

Page 168: RubyMasters 2011 - Beyond Ruby with NodeJS

em-mysql

em-http-request em-websocket

em-proxy

em-syncrony

em-redis

em-spec

em-ftpd

em-dns

em-jabberbot

em-resolv-replace

em-syslogem-dir-watcher

em-ruby-irc

em-net-http

em-s3 em-mongo

em-memcache-client em-simplechat

Page 169: RubyMasters 2011 - Beyond Ruby with NodeJS

EM-*

Page 170: RubyMasters 2011 - Beyond Ruby with NodeJS

WS-*

Page 171: RubyMasters 2011 - Beyond Ruby with NodeJS

#simplicidade

Page 172: RubyMasters 2011 - Beyond Ruby with NodeJS

Código bloqueante

Page 173: RubyMasters 2011 - Beyond Ruby with NodeJS

Código bloqueante

Código não-bloqueante

Page 174: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 175: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 176: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 177: RubyMasters 2011 - Beyond Ruby with NodeJS

Callback

Page 178: RubyMasters 2011 - Beyond Ruby with NodeJS

Callback

Callback

Page 179: RubyMasters 2011 - Beyond Ruby with NodeJS

#evolução

Page 180: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 181: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 182: RubyMasters 2011 - Beyond Ruby with NodeJS

Don’t Repeat Yourself

Page 183: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 184: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 185: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 186: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 187: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 188: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 189: RubyMasters 2011 - Beyond Ruby with NodeJS

XML

Properties

YAML

Configurações

Page 190: RubyMasters 2011 - Beyond Ruby with NodeJS

XML

Properties

YAML

Configurações

JSON

Transporte

Page 191: RubyMasters 2011 - Beyond Ruby with NodeJS

Configurações

JSON

Page 192: RubyMasters 2011 - Beyond Ruby with NodeJS

Configurações

JSON

Page 193: RubyMasters 2011 - Beyond Ruby with NodeJS

Configurações

JSON

Transporte

Page 194: RubyMasters 2011 - Beyond Ruby with NodeJS

Configurações

Javascript Object Notation

Transporte

Page 195: RubyMasters 2011 - Beyond Ruby with NodeJS

Java Ruby Python

Server Side

PHP

Page 196: RubyMasters 2011 - Beyond Ruby with NodeJS

Java Ruby Python

Server Side

PHP

Client Side

JavaScript

Page 197: RubyMasters 2011 - Beyond Ruby with NodeJS

Server Side

JavaScript

Page 198: RubyMasters 2011 - Beyond Ruby with NodeJS

Server Side

JavaScript

Page 199: RubyMasters 2011 - Beyond Ruby with NodeJS

Server Side

JavaScript

Client Side

Page 200: RubyMasters 2011 - Beyond Ruby with NodeJS

#ecossistema

Page 201: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 202: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 203: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 204: RubyMasters 2011 - Beyond Ruby with NodeJS

Sinatra detected !

Page 205: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 206: RubyMasters 2011 - Beyond Ruby with NodeJS

Testes Automatizados

Page 207: RubyMasters 2011 - Beyond Ruby with NodeJS

Testes Automatizados#https://github.com/caolan/nodeunit

Page 208: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 209: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 210: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 211: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 212: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 213: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 214: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 215: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 216: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 217: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 218: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 219: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 220: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 221: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 222: RubyMasters 2011 - Beyond Ruby with NodeJS

#LIVE

Page 223: RubyMasters 2011 - Beyond Ruby with NodeJS

on

Page 224: RubyMasters 2011 - Beyond Ruby with NodeJS

Client Ruby on Rails

Page 225: RubyMasters 2011 - Beyond Ruby with NodeJS

Client Ruby on Rails

Page 226: RubyMasters 2011 - Beyond Ruby with NodeJS

Servidor em Node.js

Page 227: RubyMasters 2011 - Beyond Ruby with NodeJS

Servidor em Node.js

Page 228: RubyMasters 2011 - Beyond Ruby with NodeJS

Código Client-Side ( JS )

Page 229: RubyMasters 2011 - Beyond Ruby with NodeJS

Código Client-Side ( JS )

Page 230: RubyMasters 2011 - Beyond Ruby with NodeJS

Código Server Coffeescript

Page 231: RubyMasters 2011 - Beyond Ruby with NodeJS

#conclusão

Page 232: RubyMasters 2011 - Beyond Ruby with NodeJS

IRuby

Page 233: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 234: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 235: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 236: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 237: RubyMasters 2011 - Beyond Ruby with NodeJS
Page 238: RubyMasters 2011 - Beyond Ruby with NodeJS

Obrigado !!!

Emerson Macedo@emerleite

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