Slide 1

Slide 1 text

Ruby on Rack

Slide 2

Slide 2 text

Ernesto Tagwerker Founder, Ombu Labs @etagwerker

Slide 3

Slide 3 text

Ruby on Rails

Slide 4

Slide 4 text

Merb

Slide 5

Slide 5 text

Sinatra

Slide 6

Slide 6 text

Cuba

Slide 7

Slide 7 text

Rack

Slide 8

Slide 8 text

If you’re familiar with Java, think javax.servlet.http.HttpServlet

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

The problem with Ruby Toolbox

Slide 12

Slide 12 text

Use the most popular gem

Slide 13

Slide 13 text

Sometimes that’s not the best solution

Slide 14

Slide 14 text

bench-micro https://github.com/ luislavena/bench-micro

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

sinatra.rb require "sinatra/base" class HelloWorld < Sinatra::Base get "/" do "Hello World!" end end APP = HelloWorld run APP

Slide 18

Slide 18 text

rails.rb class HelloWorld < Rails::Application routes.append do get "/", to: "hello#world" end config.cache_classes = true config.eager_load = true config.secret_key_base = SecureRandom.hex(64) ["Rack::Lock", "ActionDispatch::Flash", "ActionDispatch::BestStandardsSupport", "Rack::Sendfile", "ActionDispatch::Static", "Rack::MethodOverride", "ActionDispatch::RequestId", "Rails::Rack::Logger", "ActionDispatch::ShowExceptions", "ActionDispatch::DebugExceptions", "ActionDispatch::RemoteIp", "ActionDispatch::Callbacks", "ActionDispatch::Cookies", "ActionDispatch::Session::CookieStore", "ActionDispatch::ParamsParser", "Rack::Head", "Rack::ConditionalGet", "Rack::ETag"].each do |middleware| config.middleware.delete(middleware) end end class HelloController < ActionController::Metal def world self.response_body = "Hello World!" end end APP = HelloWorld.initialize! run APP

Slide 19

Slide 19 text

cuba.rb require "cuba" HelloWorld = Cuba.new do on get, root do res.write "Hello World!" end end APP = HelloWorld run APP

Slide 20

Slide 20 text

syro.rb require "syro" APP = Syro.new { get { res.write "Hello World!" } } run APP

Slide 21

Slide 21 text

hobbit.rb require "hobbit" class HelloWorld < Hobbit::Base get "/" do "Hello World!" end end APP = HelloWorld.new run APP

Slide 22

Slide 22 text

Next time you build an API, consider bench-micro

Slide 23

Slide 23 text

But convention over configuration…

Slide 24

Slide 24 text

A typical Rails app

Slide 25

Slide 25 text

hobbit-app https://github.com/ ombulabs/hobbit-app

Slide 26

Slide 26 text

A typical Hobbit app

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Thank you!

Slide 29

Slide 29 text

Questions?