Slide 1

Slide 1 text

ࣲాതࢤ SHIBATA Hiroshi QBQFSCPZDP BTBLVTBSC paperboy&co., Inc. Continuous Upgrades For Rails Apps. ൃද৔ॴ3FE%PU3VCZ$POG 2013-06-08(Sat) From 'Legacy' to 'Edge'

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

TFMG

Slide 4

Slide 4 text

SHIBATA Hiroshi(@hsbt)

Slide 5

Slide 5 text

Rails Girls in Japan

Slide 6

Slide 6 text

asakusa.rb

Slide 7

Slide 7 text

asakusa.rb takoyaki!

Slide 8

Slide 8 text

asakusa.rb

Slide 9

Slide 9 text

Ruby Committer

Slide 10

Slide 10 text

Great News

Slide 11

Slide 11 text

ruby/www.ruby-lang.org

Slide 12

Slide 12 text

Please join us

Slide 13

Slide 13 text

http://bugs.ruby-lang.org

Slide 14

Slide 14 text

asakusarb/redmine4ruby-lang

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

http://30d.jp

Slide 19

Slide 19 text

from 2007/5

Slide 20

Slide 20 text

280,000 users 174,000,000 photos

Slide 21

Slide 21 text

Our Rails app 44models 9000lines in controllers 220lines in routes.rb

Slide 22

Slide 22 text

system architecture

Slide 23

Slide 23 text

application server

Slide 24

Slide 24 text

storage api server

Slide 25

Slide 25 text

storage server

Slide 26

Slide 26 text

customer management

Slide 27

Slide 27 text

storage is over 400TB

Slide 28

Slide 28 text

Ruby 1.8.6 Rails 2.0.2

Slide 29

Slide 29 text

Rails in Kansas

Slide 30

Slide 30 text

Rails in Tokyo

Slide 31

Slide 31 text

Ruby 1.8.6 Rails 2.0.2 Ruby 2.0.0 Rails 3.2.13

Slide 32

Slide 32 text

Ruby Ruby Ruby Ruby 1.8.6 1.8.7 1.9 2.0 Rails 2.0/2.1 Rails 2.3 Rails 3.0 Rails 3.2

Slide 33

Slide 33 text

Ruby Ruby Ruby Ruby 1.8.6 1.8.7 1.9 2.0 Rails 2.0/2.1 Rails 2.3 Rails 3.0 Rails 3.2

Slide 34

Slide 34 text

Ruby Ruby Ruby Ruby 1.8.6 1.8.7 1.9 2.0 Rails 2.0/2.1 Rails 2.3 Rails 3.0 Rails 3.2

Slide 35

Slide 35 text

How to migrate edge rails from legacy rails?

Slide 36

Slide 36 text

Test to specify

Slide 37

Slide 37 text

Continuous Integration

Slide 38

Slide 38 text

staging environment

Slide 39

Slide 39 text

puppet

Slide 40

Slide 40 text

1-8 deploy/day

Slide 41

Slide 41 text

Rails 2.0 Rails 2.3

Slide 42

Slide 42 text

Rails 2.0 Rails 2.3 hotfix A migration A

Slide 43

Slide 43 text

Rails 2.0 Rails 2.3 hotfix A migration A

Slide 44

Slide 44 text

Rails 2.0 Rails 2.3 hotfix A migration A

Slide 45

Slide 45 text

offensive system operation

Slide 46

Slide 46 text

Zero Downtime Deploy

Slide 47

Slide 47 text

app1 app2

Slide 48

Slide 48 text

should not use slave-read in database caution

Slide 49

Slide 49 text

the basic of slave-read

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

cookpad/kage

Slide 52

Slide 52 text

Kage (kah-geh) is an HTTP shadow proxy server that sits between clients and your server(s) to enable "shadow requests".

Slide 53

Slide 53 text

the basic of kage real request

Slide 54

Slide 54 text

Kage::ProxyServer.start do |server| config = YAML.load_file(File.expand_path("../config.yml", __FILE__))[ENV['RAILS_ENV']] server.port = 8090 server.host = config[:host] server.debug = false # backends can share the same host/port server.add_master_backend(:production, config[:production], 8080) server.add_backend(:sandbox, config[:sandbox], 80) server.client_timeout = 15 server.backend_timeout = 10 # Dispatch all GET requests to multiple backends, otherwise only :production server.on_select_backends do |request, headers| if request[:method] == 'GET' && rand(9) == 0 [:production, :sandbox] else [:production] end end end

Slide 55

Slide 55 text

hsbt/puppet-kage

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

app1 app2

Slide 58

Slide 58 text

monitoring and alerting

Slide 59

Slide 59 text

newrelic

Slide 60

Slide 60 text

nagios

Slide 61

Slide 61 text

exception_notification

Slide 62

Slide 62 text

IRC github issue costomer’s contact nagios

Slide 63

Slide 63 text

munin

Slide 64

Slide 64 text

people

Slide 65

Slide 65 text

newcomer bootcamp sergeant sergeant sergeant

Slide 66

Slide 66 text

github and github:e

Slide 67

Slide 67 text

webistrano

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

confusion of programmer is causes of low productivity

Slide 70

Slide 70 text

Ruby Ruby Ruby Ruby 1.8.6 1.8.7 1.9 2.0 Rails 2.0/2.1 Rails 2.3 Rails 3.0 Rails 3.2 always on the edge is motivating

Slide 71

Slide 71 text

Ruby 1.8.7 Rails 2.3.18 Ruby 1.8.7 Rails 3.0.20

Slide 72

Slide 72 text

rails 2.3 with bundler

Slide 73

Slide 73 text

source 'https://rubygems.org' gem 'rails', '~> 2.3.18' gem 'rake', '~> 0.9.2' gem 'rdoc' gem 'rake-confirm' gem 'mysql' gem "mysql_retry_lost_connection" gem 'acts_as_paranoid', :github => 'paperboy-30days/acts_as_paranoid' gem 'passenger', '~> 3.0' gem 'memcache-client', :require => 'memcache' gem 'system_timer' gem 'yajl-ruby', :require => 'yajl' gem 'will_paginate', '~> 2.3' gem 'mail' gem 'sass' gem 'compass-rails' gem 'osaipo_client', :git => '[email protected]:paperboy-all/ osaipo_client.git', :branch => 'legacy' gem 'jugem_client', :git => '[email protected]:paperboy-all/ jugem_client.git' gem 'ppb_footer', :github => 'paperboy-all/ppb_footer'

Slide 74

Slide 74 text

require "./config/environment" use Rails::Rack::LogTailer use Rails::Rack::Static run ActionController::Dispatcher.new rack with rails 2.3

Slide 75

Slide 75 text

rails_upgrade plugin

Slide 76

Slide 76 text

30days-front can’t use hyphen can’t use number can’t convert application.rb...

Slide 77

Slide 77 text

conclusion

Slide 78

Slide 78 text

Ruby Ruby Ruby Ruby 1.8.6 1.8.7 1.9 2.0 Rails 2.0/2.1 Rails 2.3 Rails 3.0 Rails 3.2

Slide 79

Slide 79 text

high productivity

Slide 80

Slide 80 text

Let’s enjoy around legacy system!!