Can Time-Travel Keep You From Blowing Up The Enterprise?

Can Time-Travel Keep You From Blowing Up The Enterprise?

My talk from RailsConf 2016 on scaling rails

F74253f4a099258870157426b4cdb2dc?s=128

David Copeland

May 05, 2016
Tweet

Transcript

  1. 4.

    SCALING RAILS ▸ Do stuff Faster? ▸ Do more stuff

    at once? NO, IT'S ACTUALLY… ▸ Growing Team ▸ Growing Business ▸ Changing Business
  2. 14.

    FIRST, SOME ASSUMPTIONS ▸ Over time, more people will work

    on the code ▸ Over time, different people will work on the code
  3. 15.

    FIRST, SOME ASSUMPTIONS ▸ Over time, more people will work

    on the code ▸ Over time, different people will work on the code ▸ There will be increasing demands on the code
  4. 16.

    FAILURE: BUSINESS/PRODUCT NOT MEETING USER NEEDS ▸ Simple changes difficult

    ▸ Difficult changes impossible ▸ Low morale ▸ Brain drain
  5. 17.

    COMMON, BUT NOT UNIVERSAL ▸ Start-up ▸ New project on

    a larger company ▸ New longer-term consulting gig
  6. 18.

    COMMON, BUT NOT UNIVERSAL ▸ Start-up ▸ New project on

    a larger company ▸ New longer-term consulting gig GROWTH & CHANGE
  7. 37.

    OH, AND… ▸ Test suite is glacial ▸ Don't even

    think about looking in app/assets/javascripts ▸ /admin starts acting up -> www is dead, too ▸ Etc.
  8. 38.

    REMEMBER WHAT FAILURE LOOKS LIKE? ▸ Simple changes difficult ▸

    Difficult changes impossible ▸ Low morale ▸ Brain drain
  9. 39.

    REMEMBER WHAT FAILURE LOOKS LIKE? ▸ Simple changes difficult ▸

    Difficult changes impossible ▸ Low morale ▸ Brain drain
  10. 46.

    BEFORE EVEN STARTING… ▸ Deploy lots of apps ▸ Authentication

    ▸ Versioning ▸ JSON format ▸ Which HTTP library?
  11. 47.

    BEFORE EVEN STARTING… ▸ Deploy lots of apps ▸ Authentication

    ▸ Versioning ▸ JSON format ▸ Which HTTP library? ▸ Argue about REST and status codes
  12. 52.

    THREE MONTHS LATER ▸ React front-end ▸ Hits the Backend-for-frontends

    (BFF) ▸ BFF talks to the underlying auth service
  13. 53.

    THREE MONTHS LATER ▸ React front-end ▸ Hits the Backend-for-frontends

    (BFF) ▸ BFF talks to the underlying auth service ▸ Then hits the role service
  14. 54.

    THREE MONTHS LATER ▸ React front-end ▸ Hits the Backend-for-frontends

    (BFF) ▸ BFF talks to the underlying auth service ▸ Then hits the role service ▸ Then decorates with the consumer data
  15. 55.

    THREE MONTHS LATER ▸ React front-end ▸ Hits the Backend-for-frontends

    (BFF) ▸ BFF talks to the underlying auth service ▸ Then hits the role service ▸ Then decorates with the consumer data ▸ To render “Hello, #{first_name}!”
  16. 56.

    THREE MONTHS LATER ▸ React front-end ▸ Hits the Backend-for-frontends

    (BFF) ▸ BFF talks to the underlying auth service ▸ Then hits the role service ▸ Then decorates with the consumer data ▸ To render “Hello, #{first_name}!” ▸ Managed by Docker, Ansible, AWS, Terraform, Vault, Bash, and, of course, some Go
  17. 60.

    WHAT HAPPENED? ▸ Money has been spent ▸ Blog posts

    all over Hacker News ▸ Meetups have been attended
  18. 61.

    WHAT HAPPENED? ▸ Money has been spent ▸ Blog posts

    all over Hacker News ▸ Meetups have been attended ▸ No actual business value
  19. 62.

    WHAT HAPPENED? ▸ Money has been spent ▸ Blog posts

    all over Hacker News ▸ Meetups have been attended ▸ No actual business value ▸ Nothing to show
  20. 63.

    WHAT HAPPENED? ▸ Money has been spent ▸ Blog posts

    all over Hacker News ▸ Meetups have been attended ▸ No actual business value ▸ Nothing to show ▸ Is there any money left?
  21. 64.

    REMEMBER WHAT FAILURE LOOKS LIKE? ▸ Simple changes difficult ▸

    Difficult changes impossible ▸ Low morale ▸ Brain drain
  22. 65.

    REMEMBER WHAT FAILURE LOOKS LIKE? ▸ Simple changes difficult ▸

    Difficult changes impossible ▸ Low morale ▸ Brain drain
  23. 67.

    AS LONG AS WE _NOTICE_ THE MESS, WE CAN CLEAN

    IT UP —Pat Agîlecønßultånt
  24. 72.
  25. 75.

    CLEANING THE AIRPORT BATHROOM ▸ Requires top engineers ▸ Grueling

    ▸ Small changes difficult ▸ Bigger changes become delayed
  26. 79.

    WHILE IT'S IMPOSSIBLE TO PREDICT THE FUTURE, WE DON'T NEED

    TO ACT BLIND TO IT. Chris Reasonable
  27. 80.

    DON'T BE BLIND TO THE FUTURE ▸ More developers, more

    features, more code, more changes ▸ You'll want things decoupled; but not exactly what. ▸ Don't make a mess in the first place
  28. 81.

    ENABLE DECOUPLING ▸ One rails app per business function ▸

    No business logic in Active Record models ▸ Use the Rule of Three to guide decisions around abstraction, tooling, de- coupling, and general pattern identification.
  29. 82.

    RULE OF THREE ▸ 1st and 2nd times aren't a

    pattern. ▸ 3rd time is - use that to create needed tooling or process changes ▸ This is engineering culture ▸ Mature teams can graduate to the Rule of Two :) Effort 1ST 2ND 3RD 4TH 5TH 6TH
  30. 83.

    EXAMPLES ▸ Third Rails app - create it with a

    re-usable generator ▸ Third Ruby Gem - create it with a re-usable gem scaffold ▸ Third mess you make with jQuery - consider a front-end framework ▸ Third time customers report an outage - improve monitoring
  31. 88.

    WWW CUSTOMER SERVICE MARKETING SHARED DATABASE SHARED MODELS SHARED MODELS

    SHARED MODELS PROMO CODE LOGIC PROMO CODE LOGIC
  32. 89.

    WWW CUSTOMER SERVICE MARKETING SHARED DATABASE SHARED MODELS SHARED MODELS

    SHARED MODELS PROMO CODE LOGIC PROMO CODE LOGIC CACHE
  33. 90.

    WWW CUSTOMER SERVICE MARKETING SHARED DATABASE SHARED MODELS SHARED MODELS

    SHARED MODELS PROMO CODE LOGIC PROMO CODE LOGIC CACHE
  34. 91.

    WWW CUSTOMER SERVICE MARKETING SHARED DATABASE SHARED MODELS SHARED MODELS

    SHARED MODELS ANALYTICS PROMO CODE LOGIC PROMO CODE LOGIC CACHE
  35. 92.

    WWW CUSTOMER SERVICE MARKETING FINANCE SHARED DATABASE SHARED MODELS SHARED

    MODELS SHARED MODELS ANALYTICS PROMO CODE LOGIC PROMO CODE LOGIC CACHE
  36. 93.

    WWW CUSTOMER SERVICE MARKETING FINANCE SHARED DATABASE SHARED MODELS SHARED

    MODELS SHARED MODELS ANALYTICS PROMO CODES HTTP CACHE
  37. 94.

    WWW CUSTOMER SERVICE MARKETING FINANCE SHARED DATABASE SHARED MODELS SHARED

    MODELS SHARED MODELS ANALYTICS PROMO CODES HTTP CACHE
  38. 95.

    WWW CUSTOMER SERVICE MARKETING FINANCE SHARED DATABASE SHARED MODELS SHARED

    MODELS SHARED MODELS ANALYTICS PROMO CODES HTTP PRIVATE DATABASE CACHE
  39. 96.

    WWW CUSTOMER SERVICE MARKETING FINANCE SHARED DATABASE SHARED MODELS SHARED

    MODELS SHARED MODELS ANALYTICS PROMO CODES HTTP PRIVATE DATABASE PRIVATE DATABASE CACHE
  40. 100.

    WHAT DID WE LEARN EXACTLY? ▸ Don't be blind to

    the future (this is different than predicting it!) ▸ Write code to enable change ▸ Create a culture of change, based on the Rule of Three ▸ Your architecture must evolve and is never "done" ▸ Don't make a mess
  41. 101.

    25% off CODE RailsConf16 FULL-STACK-RAILS.COM SWENG.ME NEED RANTS ABOUT BAD

    UX AND JAVASCRIPT? @DAVETRON5000 WANT TO WORK THIS WAY? TECH.STITCHFIX.COM/CAREERS/ FINAL SLIDE OF SELF-PROMOTION