Building Services On and Off Rails

0a5b413991ed9a58bb8845f7ecab7106?s=47 Yan Pritzker
September 12, 2013

Building Services On and Off Rails

How to build JSON services using Ruby, Grape, and Roar, and how to operationalize them by embedding them inside of Rails apps or running them standalone.

0a5b413991ed9a58bb8845f7ecab7106?s=128

Yan Pritzker

September 12, 2013
Tweet

Transcript

  1. Building Services on and off Rails

  2. SLIDES AT bit.ly/reverb-soa

  3. 3 TAKEAWAYS

  4. WHY WRITE SERVICES RECOMMENDED STACK EMBEDDED VS. STANDALONE

  5. WHY WRITE SERVICES RECOMMENDED STACK EMBEDDED VS. STANDALONE

  6. WHY WRITE SERVICES RECOMMENDED STACK EMBEDDED VS. STANDALONE

  7. Yan Pritzker, CTO Reverb.com github.com/skwp @skwp github.com/reverbdev @reverbdotcom

  8. Yan Pritzker, CTO Reverb.com github.com/skwp @skwp github.com/reverbdev @reverbdotcom On Rails

    since 2005 (0.13.4)
  9. None
  10. RAILS IS EASY

  11. RAILS IS FUN

  12. RAILS IS BLOATED

  13. STARTUP 10-20s

  14. HOW DID WE GET HERE?

  15. MONOLITHS

  16. LOTS OF GEMS

  17. LOTS OF CONTROLLERS

  18. LOTS OF MODELS

  19. LOTS OF LIBS

  20. LOTS OF DOMAIN

  21. SOLUTION? SERVICES

  22. A SERVICE IS...

  23. BITS OF ISOLATED FUNCTOINALITY

  24. BEHIND A BIG WALL

  25. SPEAKING JSON

  26. WHY?

  27. SCALE YOUR TEAM

  28. SCALE DOWNTIME

  29. SCALE PERFORMANCE

  30. SCALE PRODUCTIVITY

  31. SCALE HAPPINESS

  32. DIVORCE FROM RAILS AND...

  33. FAST SPECS

  34. EXPERIMENT WITH FRAMEWORKS

  35. EXPERIMENT WITH LANGUAGES

  36. EXPERIMENT WITH ARCHITECTURE

  37. OUR STACK

  38. Grape API

  39. Grape API Roar Representers

  40. Grape API Roar Representers application/hal+json

  41. Grape API Roar Representers application/hal+json ActiveRecord

  42. Grape API Roar Representers application/hal+json Or Something Else

  43. DEPLOYMENT?

  44. EMBED IT!

  45. CREATE THE GEM

  46. WRITE GRAPE API

  47. PUT IT ON RAILS

  48. github.com/reverbdev/chimp Gemified Service Example

  49. EMBEDDING IS EASY

  50. AND YOU CAN DEVELOP IN ISOLATION

  51. BUT IT’S NOT IDEAL

  52. DEPENDENCY CONFLICTS

  53. CONSTRAINS RUBY VERSION

  54. ADDS TO APP BLOAT

  55. DEPLOY IT STANDALONE!

  56. THIN / UNICORN

  57. FOREMAN / UPSTART

  58. MINA / CAPISTRANO

  59. REVERB STANDALONE SERVICE SKELETON github.com/reverbdev/service-skeleton

  60. We’re Hiring! Rubyists/iOS/ Musicians