Building Services on and off Rails

61
Building Services on and off Rails

description

Build Ruby services with Grape and Roar and embed into Rails or run standalone. Provides working examples of both.

Transcript of Building Services on and off Rails

Page 1: Building Services on and off Rails

Building Services on and off Rails

Page 2: Building Services on and off Rails

SLIDES ATbit.ly/reverb-soa

Page 3: Building Services on and off Rails

3 TAKEAWAYS

Page 4: Building Services on and off Rails

WHY WRITE SERVICESRECOMMENDED STACK

EMBEDDED VS. STANDALONE

Page 5: Building Services on and off Rails

WHY WRITE SERVICESRECOMMENDED STACK

EMBEDDED VS. STANDALONE

Page 6: Building Services on and off Rails

WHY WRITE SERVICESRECOMMENDED STACK

EMBEDDED VS. STANDALONE

Page 7: Building Services on and off Rails

Yan Pritzker, CTOReverb.com

github.com/skwp @skwp

github.com/reverbdev @reverbdotcom

Page 8: Building Services on and off Rails

Yan Pritzker, CTOReverb.com

github.com/skwp @skwp

github.com/reverbdev @reverbdotcom

On Rails since 2005 (0.13.4)

Page 9: Building Services on and off Rails
Page 10: Building Services on and off Rails

RAILSIS EASY

Page 11: Building Services on and off Rails

RAILSIS FUN

Page 12: Building Services on and off Rails

RAILSIS BLOATED

Page 13: Building Services on and off Rails

STARTUP10-20s

Page 14: Building Services on and off Rails

HOW DID WE GET HERE?

Page 15: Building Services on and off Rails

MONOLITHS

Page 16: Building Services on and off Rails

LOTS OF GEMS

Page 17: Building Services on and off Rails

LOTS OF CONTROLLERS

Page 18: Building Services on and off Rails

LOTS OF MODELS

Page 19: Building Services on and off Rails

LOTS OF LIBS

Page 20: Building Services on and off Rails

LOTS OF DOMAIN

Page 21: Building Services on and off Rails

SOLUTION?SERVICES

Page 22: Building Services on and off Rails

A SERVICE IS...

Page 23: Building Services on and off Rails

BITS OF ISOLATED

FUNCTOINALITY

Page 24: Building Services on and off Rails

BEHIND A BIG WALL

Page 25: Building Services on and off Rails

SPEAKING JSON

Page 26: Building Services on and off Rails

WHY?

Page 27: Building Services on and off Rails

SCALEYOUR TEAM

Page 28: Building Services on and off Rails

SCALEDOWNTIME

Page 29: Building Services on and off Rails

SCALEPERFORMANCE

Page 30: Building Services on and off Rails

SCALEPRODUCTIVITY

Page 31: Building Services on and off Rails

SCALEHAPPINESS

Page 32: Building Services on and off Rails

DIVORCE FROM RAILS AND...

Page 33: Building Services on and off Rails

FAST SPECS

Page 34: Building Services on and off Rails

EXPERIMENTWITH

FRAMEWORKS

Page 35: Building Services on and off Rails

EXPERIMENTWITH

LANGUAGES

Page 36: Building Services on and off Rails

EXPERIMENTWITH

ARCHITECTURE

Page 37: Building Services on and off Rails

OUR STACK

Page 38: Building Services on and off Rails

Grape API

Page 39: Building Services on and off Rails

Grape API

Roar Representers

Page 40: Building Services on and off Rails

Grape API

Roar Representers

application/hal+json

Page 41: Building Services on and off Rails

Grape API

Roar Representers

application/hal+json

ActiveRecord

Page 42: Building Services on and off Rails

Grape API

Roar Representers

application/hal+json

Or Something Else

Page 43: Building Services on and off Rails

DEPLOYMENT?

Page 44: Building Services on and off Rails

EMBED IT!

Page 45: Building Services on and off Rails

CREATE THE GEM

Page 46: Building Services on and off Rails

WRITE GRAPE API

Page 47: Building Services on and off Rails

PUT IT ON RAILS

Page 48: Building Services on and off Rails

github.com/reverbdev/chimp

Gemified Service Example

Page 49: Building Services on and off Rails

EMBEDDINGIS EASY

Page 50: Building Services on and off Rails

AND YOU CAN DEVELOP IN ISOLATION

Page 51: Building Services on and off Rails

BUT IT’SNOT IDEAL

Page 52: Building Services on and off Rails

DEPENDENCY CONFLICTS

Page 53: Building Services on and off Rails

CONSTRAINS RUBY VERSION

Page 54: Building Services on and off Rails

ADDS TOAPP BLOAT

Page 55: Building Services on and off Rails

DEPLOY ITSTANDALONE!

Page 56: Building Services on and off Rails

THIN /UNICORN

Page 57: Building Services on and off Rails

FOREMAN / UPSTART

Page 58: Building Services on and off Rails

MINA / CAPISTRANO

Page 59: Building Services on and off Rails

SERVICE SKELETON

github.com/reverbdev/service-skeleton

Page 60: Building Services on and off Rails
Page 61: Building Services on and off Rails

We’re Hiring!Rubyists/iOS/

Musicians