Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RailsClub 2016

RailsClub 2016

Kir Shatrov

October 22, 2016
Tweet

More Decks by Kir Shatrov

Other Decks in Programming

Transcript

  1. Monolithic Rails: 

    deal with it
    Railsclub 2016


    Kir Shatrov

    View full-size slide

  2. Kir Shatrov
    Developer acceleration @ Shopify
    "
    Rails, Capistrano, RubyBench

    View full-size slide

  3. Developer acceleration team

    View full-size slide

  4. Rails
    Ruby
    Developer Tools

    View full-size slide

  5. git clone …
    brew install postgres
    brew install redis
    bundle install
    rake db:create

    View full-size slide

  6. git clone …
    brew install postgres
    brew install redis
    bundle install
    rake db:create
    где-то тут ломается nokogiri

    View full-size slide

  7. git clone …
    brew install postgres
    brew install redis
    rake db:create
    vagrant up

    View full-size slide

  8. VM creation is slow
    VM has to be updated every week from Chef
    Development in VM is slower
    VM file system has limitations for frontend stuff

    View full-size slide

  9. The xhyve hypervisor is a port of bhyve to OS X.
    It is built on top of Hypervisor.framework in OS X
    10.10 Yosemite and higher, runs entirely in
    userspace, and has no other dependencies.

    View full-size slide

  10. install Homebrew packages
    provision language and dependencies
    ruby, node, go
    create and prepare database
    setup Git hooks

    View full-size slide

  11. git clone …
    brew install postgres
    brew install redis
    rake db:create
    dev up

    View full-size slide

  12. Detect dangerous patterns ☠

    View full-size slide

  13. Detect dangerous patterns
    changing existing migrations
    adding new gems
    changing application configuration

    View full-size slide

  14. ⚰ Rails upgrade

    View full-size slide

  15. 1. Make your application boot (fix gem conflicts)
    2. Setup two Gemfiles and two CI statuses
    3. Fix failings tests
    4. Deploy to 10% of nodes

    View full-size slide

  16. 1. Make your application boot (fix gem conflicts)
    2. Setup two Gemfiles and two CI statuses
    3. Fix failings tests
    4. Deploy to 10% of nodes

    View full-size slide

  17. 1. Make your application boot (fix gem conflicts)
    2. Setup two Gemfiles and two CI statuses
    3. Fix failings tests
    4. Gradually deploy

    View full-size slide

  18. ⏱ Application boot ⏱

    View full-size slide

  19. $ rails new railsclub --skip-spring
    $ time bundle exec rails runner "puts 1+1"
    2
    0.64s user 0.09s system 24% cpu 2.969 total

    View full-size slide

  20. require 'activerecord'
    require '/Users/kir/Projects/shopify/vendor/bundle/gems/
    activerecord-4.2.7.1/lib/activerecord.rb'

    View full-size slide

  21. github.com/byroot/bootscale

    View full-size slide

  22. block any external calls from inside database
    transaction
    instrument Net::HTTP by host
    lint database migrations
    circuit breaker

    View full-size slide

  23. continuous improvements
    share as many tools as possible
    make people happy

    View full-size slide

  24. shopify.com/careers

    View full-size slide

  25. @kirs
    @kirshatrov
    Спасибо!

    View full-size slide