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

Chanko

 Chanko

This slide I present in RailsConf2012 is describes how COOKPAD safely releases
multiple feature prototypes - in production -
for test segments of their 15 million engaged users.

http://github.com/cookpad/chanko

Kenta Murata

April 26, 2012
Tweet

More Decks by Kenta Murata

Other Decks in Programming

Transcript

  1. Chanko How COOKPAD safely releases multiple feature prototypes - in

    production - for test segments of their 15 million engaged users @mrkn (Kenta Murata), @shingo (Shingo Morita) http://www.flickr.com/photos/june29/3396011694/ 1 12೥4݄26೔໦༵೔
  2. Kenta Murata • CRuby committer • bigdecimal maintainer • OS

    X platform maintainer • Ruby Sapporo @mrkn http://www.flickr.com/photos/recompile_net/5951998279/ 2 12೥4݄26೔໦༵೔
  3. Data Monthly unique users: 15 M Monthly page views: 500

    M http://cookpad.com/ 4 12೥4݄26೔໦༵೔
  4. Data Monthly unique users: 15 M Monthly page views: 500

    M Engineers: 40 http://cookpad.com/ 4 12೥4݄26೔໦༵೔
  5. Data Monthly unique users: 15 M Monthly page views: 500

    M Engineers: 40 System http://cookpad.com/ 4 12೥4݄26೔໦༵೔
  6. Data Monthly unique users: 15 M Monthly page views: 500

    M Engineers: 40 System Ruby: Ruby Enterprise Edition http://cookpad.com/ 4 12೥4݄26೔໦༵೔
  7. Data Monthly unique users: 15 M Monthly page views: 500

    M Engineers: 40 System Ruby: Ruby Enterprise Edition Rails: 3.0 http://cookpad.com/ 4 12೥4݄26೔໦༵೔
  8. Data Monthly unique users: 15 M Monthly page views: 500

    M Engineers: 40 System Ruby: Ruby Enterprise Edition Rails: 3.0 Platform: AWS http://cookpad.com/ 4 12೥4݄26೔໦༵೔
  9. IDEA BUILD USER INTERVIEW USER TEST LEARN Public release In

    the office Before Chanko http://www.flickr.com/photos/13963375@N00/138745886/ 8 12೥4݄26೔໦༵೔
  10. After Chanko IDEA BUILD Limited release IDEA MEASURE Public release

    RELEASE http://photozou.jp/photo/show/606813/95100763 http://photozou.jp/photo/show/276167/58451178 BUILD LEARN 10 12೥4݄26೔໦༵೔
  11. Generating unit RAILS_ROOT:$ rails generate chanko new_search_btn create app/units/new_search_btn/new_search_btn. create

    app/units/new_search_btn/views/_show.htm create app/units/new_search_btn/specs/controlle create app/units/new_search_btn/specs/models/ne create app/units/new_search_btn/specs/helpers/n create app/units/new_search_btn/stylesheets/new create app/units/new_search_btn/javascripts/new create app/assets/javascripts/units/new_search_ create app/units/new_search_btn/images/logo.png create app/assets/images/units/new_search_btn 20 12೥4݄26೔໦༵೔
  12. Files and Folders app/units/new_search_btn/new_search_btn.rb /images/ /javascripts/ /specs/ /stylesheets/ /views/ Unit

    Script Unit script consists of extensions for: • Models • Controllers • Helpers • Views 22 12೥4݄26೔໦༵೔
  13. Implementing a unit # app/units/new_search_btn/new_search_btn.rb module NewSearchBtn include Chanko::Unit active_if

    do |context, opts| context.current_user.staff? end scope(:view) do function(:search_btn) do render ‘recipes/new_search’ end end end 24 12೥4݄26೔໦༵೔
  14. Implementing a unit # app/units/new_search_btn/new_search_btn.rb module NewSearchBtn include Chanko::Unit active_if

    do |context, opts| context.current_user.staff? end scope(:view) do function(:search_btn) do render ‘recipes/new_search’ end end end active_if do |context, opts| context.current_user.staff? end 25 12೥4݄26೔໦༵೔
  15. Implementing a unit # app/units/new_search_btn/new_search_btn.rb module NewSearchBtn include Chanko::Unit active_if

    do |context, opts| context.current_user.staff? end scope(:view) do function(:search_btn) do render ‘recipes/new_search’ end end end scope(:view) do function(:search_btn) do render ‘recipes/new_search’ end end 26 12೥4݄26೔໦༵೔
  16. Invoking a function # app/views/recipes/_header.html.haml = invoke(:new_search_btn, :search_btn) do =

    render ‘recipes/search’ # app/units/new_search_btn/new_search_btn.rb module NewSearchBtn scope(:view) do function(:search_btn) do render ‘recipes/new_search’ end end end 28 12೥4݄26೔໦༵೔
  17. Invoking a function # app/views/recipes/_header.html.haml = invoke(:new_search_btn, :search_btn) do =

    render ‘recipes/search’ # app/units/new_search_btn/new_search_btn.rb module NewSearchBtn scope(:view) do function(:search_btn) do render ‘recipes/new_search’ end end end NewSearchBtn :search_btn :new_search_btn :search_btn 29 12೥4݄26೔໦༵೔
  18. Invoking a function # app/views/recipes/_header.html.haml = invoke(:new_search_btn, :search_btn) do =

    render ‘recipes/search’ # app/units/new_search_btn/new_search_btn.rb module NewSearchBtn scope(:view) do function(:search_btn) do render ‘recipes/new_search’ end end end NewSearchBtn :search_btn :new_search_btn :search_btn 29 12೥4݄26೔໦༵೔
  19. invoke method A default block is called when • The

    unit is not activated for the current user • Errors occur in a function invoke(:unit_name, :register_name) do # default processes end 34 12೥4݄26೔໦༵೔
  20. scope for controllers scope "UserController" do function :function_name do #

    some processes end end 36 12೥4݄26೔໦༵೔
  21. Model module ExampleChankoUnit include Chanko::Unit models do expand "User" do

    has_many :comments def blacklist! # code end class_methods do def rank # code end end end end end 37 12೥4݄26೔໦༵೔
  22. Differences from Engine Engine Chanko Objective Overwrite existing application feature

    Provide independent feature Standalone × O Reusability × O Stability O × 40 12೥4݄26೔໦༵೔
  23. Developed in a year > 200 Currently active units 30

    ~ 40 How many units 43 12೥4݄26೔໦༵೔