SlideShare uma empresa Scribd logo
1 de 85
Baixar para ler offline
! 
From ‘Legacy' to ‘Edge' 
2014 edition 
! 
Hiroshi SHIBATA 
@hsbt 
RubyConfTaiwan 2014
Thank you!
SHIBATA Hiroshi(@hsbt)
Ruby Committer
ruby-lang.org
Rails Girls in Japan
asakusa.rb
ミドルウェアのアップグレード 
アクセス解析基盤の構築 
セキュリティ監査 
Ruby/Rails 
技術リ基ーンス盤タートチアップ 
ーム 
社内開発基盤の構築 
JSOXの運用整備 
統計基盤の構築 
github 
テスト基盤の構築コードレビュー 
新人教育 
開発プロセス 
原稿執筆 
カンファレンス発表 
Jenkins 
RDBMS 
OSS開発サーバー構成管理の刷新
http://30d.jp
from 2008/4
380,000 users 
230,000,000 photos
Our Rails app 
46 models 
5000 lines in controllers 
400 lines in routes.rb 
1:1.3 code to test ratio
system architecture
application server
storage server
job server
transaction server
storage is over 
450 TB
database size 
is over 
250 GB
Development 
Culture
github workflow
IRC 
github issue 
costomer’s 
contact 
nagios
DevOps
4 deploy/day
How to migrate 
edge rails 
from 
legacy rails?
Ruby 1.8.6 
Rails 2.0.2
Ruby 1.8.6 
Rails 2.0.2 
Ruby 2.1.1 
Rails 4.1.0 new!
Why?
Ruby on Rails
Ruby 
1.8.6 1.8.7 1.9.3 2.0.0 2.1 
Rails 
2.0/2.1 
2.3 
3.0 
3.2 
4.0
Ruby 
1.8.6 1.8.7 1.9.3 2.0.0 2.1 
Rails 
2.0/2.1 
2.3 
3.0 
3.2 
Slow 
4.0 Fast
Ruby 
1.8.6 1.8.7 1.9.3 2.0.0 2.1 
Rails 
2.0/2.1 
2.3 
3.0 
3.2 
4.0
Ruby 
1.8.6 1.8.7 1.9.3 2.0.0 2.1 
Rails 
2.0/2.1 
2.3 
3.0 
3.2 
4.0
Ruby 
1.8.6 1.8.7 1.9.3 2.0.0 2.1 
Rails 
2.0/2.1 
2.3 
3.0 
3.2 
4.0
Rails 2.0 
Rails 2.3
Rails 2.0 
hotfix A 
Rails 2.3 
migration A
Rails 2.0 
hotfix A 
Rails 2.3 
migration A
Rails 2.0 
hotfix A 
Rails 2.3 
migration A
Zero 
Downtime 
Deploy
cookpad/kage
Kage (kah-geh) is an HTTP shadow 
proxy server that sits between 
clients and your server(s) to 
enable "shadow requests".
the basic of kage 
real request
Ruby 
1.8.6 1.8.7 1.9.3 2.0.0 2.1 
Rails 
2.0/2.1 
2.3 
3.0 
3.2 
4.0
rails 2.3 with bundler
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 => 'git@github.com:paperboy-all/ 
osaipo_client.git', :branch => 'legacy'! 
gem 'jugem_client', :git => 'git@github.com:paperboy-all/ 
jugem_client.git'! 
gem 'ppb_footer', :github => 'paperboy-all/ppb_footer'!
require "./config/environment"! 
! 
use Rails::Rack::LogTailer! 
use Rails::Rack::Static! 
run ActionController::Dispatcher.new 
rack with rails 2.3
can’t use 
hyphen 
30days-front 
can’t use 
number 
can’t convert 
! application.rb...
Reduce 
customer frustration.
app1 
app2 
backgroundrb to dj
Ruby 
1.8.6 1.8.7 1.9.3 2.0.0 2.1 
Rails 
2.0/2.1 
2.3 
3.0 
3.2 
4.0
Use trunk everyday.
1.8 to 2.0
2.0 to 2.1
CPU Usage(%) 
100 
75 
50 
25 
0 
49 
2.0 2.1 
69
Resp. time(ms) 
250 
200 
150 
100 
50 
0 
189 
2.0 2.1 
221
4 
3 
memory usage(giga byte) 0 
2 
1 
3.8 
2.0 2.1 
3.2
https://www.ruby-lang.org/en/news/2014/03/10/regression-of-hash-reject-in-ruby-2-1-1/
Ruby 
1.8.6 1.8.7 1.9.3 2.0.0 2.1 
Rails 
2.0/2.1 
2.3 
3.0 
3.2 
4.0
Use modern architecture
app1 
app2
kyoto tycoon is slower 
than mysql…
Resp. time(ms) 
300 
240 
180 
120 
60 
0 
287 
3.2 4.0 
189
Ruby 
1.9.3 2.0.0 2.1 2.2 
Rails 
3.0 
3.2 ? 
4.0 ? 
4.1 ?
Ruby 
1.9.3 2.0.0 2.1 2.2 
Rails 
3.0 
3.2 ? 
4.0 ? 
New!! 
4.1 ?
1. Flash structure changes 
2. Mutator methods called on Relation
Resp. time(ms) 
300 
240 
180 
120 
60 
0 
266 
4.0 4.1 
287
Ruby 
1.9.3 2.0.0 2.1 2.2 
Rails 
3.0 
3.2 ? 
4.0 ? 
4.1 ?
class Bar! 
def bar(foo = foo())! 
foo! 
end! 
! 
def buzz(foo = foo)! 
foo! 
end! 
! 
def foo! 
:buzz! 
end! 
end! 
! 
p Bar.new.bar! 
p Bar.new.buzz
% ruby -v r45272.rb! 
ruby 2.2.0dev (2014-04-13 trunk 45580) [x86_64-darwin13]! 
:buzz! 
nil! 
! 
% ruby -v r45272.rb! 
ruby 2.1.2p80 (2014-03-01 revision 45231) [x86_64-darwin13.0]! 
:buzz! 
:buzz
conclusion
1. fix your code 
2. fix gem 
3. fix Rails 
4. fix Ruby

Mais conteúdo relacionado

Mais procurados

The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for RubyHiroshi SHIBATA
 
20141210 rakuten techtalk
20141210 rakuten techtalk20141210 rakuten techtalk
20141210 rakuten techtalkHiroshi SHIBATA
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the worldHiroshi SHIBATA
 
Dependency Resolution with Standard Libraries
Dependency Resolution with Standard LibrariesDependency Resolution with Standard Libraries
Dependency Resolution with Standard LibrariesHiroshi SHIBATA
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled BundlerHiroshi SHIBATA
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the worldHiroshi SHIBATA
 
Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3Hiroshi SHIBATA
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Hiroshi SHIBATA
 
20140626 red dotrubyconf2014
20140626 red dotrubyconf201420140626 red dotrubyconf2014
20140626 red dotrubyconf2014Hiroshi SHIBATA
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of RubyHiroshi SHIBATA
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard wayHiroshi SHIBATA
 
Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard WayHiroshi SHIBATA
 
Leave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraLeave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraHiroshi SHIBATA
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyHiroshi SHIBATA
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHiroshi SHIBATA
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Hiroshi SHIBATA
 

Mais procurados (20)

The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for Ruby
 
20141210 rakuten techtalk
20141210 rakuten techtalk20141210 rakuten techtalk
20141210 rakuten techtalk
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 
Dependency Resolution with Standard Libraries
Dependency Resolution with Standard LibrariesDependency Resolution with Standard Libraries
Dependency Resolution with Standard Libraries
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
 
The Future of Bundled Bundler
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled Bundler
 
Gems on Ruby
Gems on RubyGems on Ruby
Gems on Ruby
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 
What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
 
Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 
20140626 red dotrubyconf2014
20140626 red dotrubyconf201420140626 red dotrubyconf2014
20140626 red dotrubyconf2014
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of Ruby
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard way
 
Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard Way
 
Leave end-to-end testing to Capybara
Leave end-to-end testing to CapybaraLeave end-to-end testing to Capybara
Leave end-to-end testing to Capybara
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 

Semelhante a 20140425 ruby conftaiwan2014

Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - DeploymentFabio Akita
 
.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011Fabio Akita
 
09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do rails09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do railsDNAD
 
Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14GABeech
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)Flowdock
 
Toster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsToster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsFabio Akita
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options.toster
 
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginnerRuby on Rails workshop for beginner
Ruby on Rails workshop for beginnerUmair Amjad
 
Ecossistema Ruby - versão SCTI UNF 2013
Ecossistema Ruby - versão SCTI UNF 2013Ecossistema Ruby - versão SCTI UNF 2013
Ecossistema Ruby - versão SCTI UNF 2013Fabio Akita
 
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogicRakuten Group, Inc.
 

Semelhante a 20140425 ruby conftaiwan2014 (20)

Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Deployment de Rails
Deployment de RailsDeployment de Rails
Deployment de Rails
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 
.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011
 
09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do rails09 - Fábio Akita - Além do rails
09 - Fábio Akita - Além do rails
 
Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14
 
RESTful OGC Services
RESTful OGC ServicesRESTful OGC Services
RESTful OGC Services
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 
Sinatra
SinatraSinatra
Sinatra
 
Toster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsToster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability Options
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options
 
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginnerRuby on Rails workshop for beginner
Ruby on Rails workshop for beginner
 
Ecossistema Ruby - versão SCTI UNF 2013
Ecossistema Ruby - versão SCTI UNF 2013Ecossistema Ruby - versão SCTI UNF 2013
Ecossistema Ruby - versão SCTI UNF 2013
 
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
[Rakuten TechConf2014] [C-5] Ichiba Architecture on ExaLogic
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
Gemlist
GemlistGemlist
Gemlist
 
Gemlist
GemlistGemlist
Gemlist
 
Gemlist
GemlistGemlist
Gemlist
 
Gemlist
GemlistGemlist
Gemlist
 

Mais de Hiroshi SHIBATA

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Deep dive into Ruby's require - RubyConf Taiwan 2023
Deep dive into Ruby's require - RubyConf Taiwan 2023Deep dive into Ruby's require - RubyConf Taiwan 2023
Deep dive into Ruby's require - RubyConf Taiwan 2023Hiroshi SHIBATA
 
How resolve Gem dependencies in your code?
How resolve Gem dependencies in your code?How resolve Gem dependencies in your code?
How resolve Gem dependencies in your code?Hiroshi SHIBATA
 
How resolve Gem dependencies in your code?
How resolve Gem dependencies in your code?How resolve Gem dependencies in your code?
How resolve Gem dependencies in your code?Hiroshi SHIBATA
 
Ruby コミッターと歩む Ruby を用いたプロダクト開発
Ruby コミッターと歩む Ruby を用いたプロダクト開発Ruby コミッターと歩む Ruby を用いたプロダクト開発
Ruby コミッターと歩む Ruby を用いたプロダクト開発Hiroshi SHIBATA
 
Why ANDPAD commit Ruby and RubyKaigi?
Why ANDPAD commit Ruby and RubyKaigi?Why ANDPAD commit Ruby and RubyKaigi?
Why ANDPAD commit Ruby and RubyKaigi?Hiroshi SHIBATA
 
RailsGirls から始める エンジニアリングはじめの一歩
RailsGirls から始める エンジニアリングはじめの一歩RailsGirls から始める エンジニアリングはじめの一歩
RailsGirls から始める エンジニアリングはじめの一歩Hiroshi SHIBATA
 
Productive Organization with Ruby
Productive Organization with RubyProductive Organization with Ruby
Productive Organization with RubyHiroshi SHIBATA
 
The secret of programming language development and future
The secret of programming  language development and futureThe secret of programming  language development and future
The secret of programming language development and futureHiroshi SHIBATA
 
Gemification plan of Standard Library on Ruby
Gemification plan of Standard Library on RubyGemification plan of Standard Library on Ruby
Gemification plan of Standard Library on RubyHiroshi SHIBATA
 

Mais de Hiroshi SHIBATA (11)

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Deep dive into Ruby's require - RubyConf Taiwan 2023
Deep dive into Ruby's require - RubyConf Taiwan 2023Deep dive into Ruby's require - RubyConf Taiwan 2023
Deep dive into Ruby's require - RubyConf Taiwan 2023
 
How resolve Gem dependencies in your code?
How resolve Gem dependencies in your code?How resolve Gem dependencies in your code?
How resolve Gem dependencies in your code?
 
How resolve Gem dependencies in your code?
How resolve Gem dependencies in your code?How resolve Gem dependencies in your code?
How resolve Gem dependencies in your code?
 
Ruby コミッターと歩む Ruby を用いたプロダクト開発
Ruby コミッターと歩む Ruby を用いたプロダクト開発Ruby コミッターと歩む Ruby を用いたプロダクト開発
Ruby コミッターと歩む Ruby を用いたプロダクト開発
 
Why ANDPAD commit Ruby and RubyKaigi?
Why ANDPAD commit Ruby and RubyKaigi?Why ANDPAD commit Ruby and RubyKaigi?
Why ANDPAD commit Ruby and RubyKaigi?
 
RailsGirls から始める エンジニアリングはじめの一歩
RailsGirls から始める エンジニアリングはじめの一歩RailsGirls から始める エンジニアリングはじめの一歩
RailsGirls から始める エンジニアリングはじめの一歩
 
Productive Organization with Ruby
Productive Organization with RubyProductive Organization with Ruby
Productive Organization with Ruby
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
 
The secret of programming language development and future
The secret of programming  language development and futureThe secret of programming  language development and future
The secret of programming language development and future
 
Gemification plan of Standard Library on Ruby
Gemification plan of Standard Library on RubyGemification plan of Standard Library on Ruby
Gemification plan of Standard Library on Ruby
 

20140425 ruby conftaiwan2014