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

7cca11c5257fda526eeb4b1ada28f904?s=128

Kenta Murata

April 26, 2012
Tweet

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. 3 12೥4݄26೔໦༵೔

  4. http://cookpad.com/ 4 12೥4݄26೔໦༵೔

  5. http://cookpad.com/ 4 12೥4݄26೔໦༵೔

  6. Data http://cookpad.com/ 4 12೥4݄26೔໦༵೔

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

  8. Data Monthly unique users: 15 M Monthly page views: 500

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

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

    M Engineers: 40 System http://cookpad.com/ 4 12೥4݄26೔໦༵೔
  11. 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೔໦༵೔
  12. 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೔໦༵೔
  13. 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೔໦༵೔
  14. Chanko http://www.flickr.com/photos/june29/3396011694/ 5 12೥4݄26೔໦༵೔

  15. •Overview •Demonstration •Usage •Chanko in COOKPAD Topics 6 12೥4݄26೔໦༵೔

  16. OVERVIEW 7 12೥4݄26೔໦༵೔

  17. 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೔໦༵೔
  18. Persona Method User interview User test 9 12೥4݄26೔໦༵೔

  19. Persona Method User interview User test 9 12೥4݄26೔໦༵೔

  20. 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೔໦༵೔
  21. Implement Bomb 11 12೥4݄26೔໦༵೔

  22. Three Requirements 12 12೥4݄26೔໦༵೔

  23. http://www.flickr.com/photos/ficablok38/5216979355/ Stability 13 12೥4݄26೔໦༵೔

  24. http://www.flickr.com/photos/boojee/29777131/ 14 12೥4݄26೔໦༵೔

  25. Faster Development http://digimaga.net/uploads/2010/02/neet-that-typing-speed-is-the-japans-fastest01.jpg 15 12೥4݄26೔໦༵೔

  26. Three Requirements Stability Quality Faster Development 16 12೥4݄26೔໦༵೔

  27. Chanko https://github.com/cookpad/chanko 17 12೥4݄26೔໦༵೔

  28. What can Chanko do? 18 12೥4݄26೔໦༵೔

  29. What can Chanko do? 18 12೥4݄26೔໦༵೔

  30. What can Chanko do? 19 12೥4݄26೔໦༵೔

  31. What can Chanko do? NoMethodError: private method `sub' called for

    nil:NilClass 19 12೥4݄26೔໦༵೔
  32. What can Chanko do? NoMethodError: private method `sub' called for

    nil:NilClass 19 12೥4݄26೔໦༵೔
  33. 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೔໦༵೔
  34. Files and Folders app/units/new_search_btn/new_search_btn.rb /images/ /javascripts/ /specs/ /stylesheets/ /views/ 21

    12೥4݄26೔໦༵೔
  35. Files and Folders app/units/new_search_btn/new_search_btn.rb /images/ /javascripts/ /specs/ /stylesheets/ /views/ Chanko

    Unit 21 12೥4݄26೔໦༵೔
  36. Files and Folders app/units/new_search_btn/new_search_btn.rb /images/ /javascripts/ /specs/ /stylesheets/ /views/ 22

    12೥4݄26೔໦༵೔
  37. Files and Folders app/units/new_search_btn/new_search_btn.rb /images/ /javascripts/ /specs/ /stylesheets/ /views/ Unit

    Script 22 12೥4݄26೔໦༵೔
  38. 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೔໦༵೔
  39. Files and Folders app/units/new_search_btn/new_search_btn.rb /images/ /javascripts/ /specs/ /stylesheets/ /views/ 23

    12೥4݄26೔໦༵೔
  40. Files and Folders app/units/new_search_btn/new_search_btn.rb /images/ /javascripts/ /specs/ /stylesheets/ /views/ Other

    stuff 23 12೥4݄26೔໦༵೔
  41. 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೔໦༵೔
  42. 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೔໦༵೔
  43. 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೔໦༵೔
  44. Invoking a function # app/views/recipes/_header.html.haml = render ‘recipes/search’ 27 12೥4݄26೔໦༵೔

  45. Invoking a function # app/views/recipes/_header.html.haml = invoke(:new_search_btn, :search_btn) do =

    render ‘recipes/search’ 28 12೥4݄26೔໦༵೔
  46. 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೔໦༵೔
  47. 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೔໦༵೔
  48. 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೔໦༵೔
  49. Staff Users 30 12೥4݄26೔໦༵೔

  50. Live Demo 31 12೥4݄26೔໦༵೔

  51. Chanko Details 32 12೥4݄26೔໦༵೔

  52. invoke(:unit_name, :register_name) invoke method 33 12೥4݄26೔໦༵೔

  53. invoke(:unit_name, :register_name) invoke method class ApplicationController include Chanko::Invoker end 33

    12೥4݄26೔໦༵೔
  54. invoke method invoke(:unit_name, :register_name) do # default processes end 34

    12೥4݄26೔໦༵೔
  55. 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೔໦༵೔
  56. invoke method invoke([:unit_name, :function_name], [:unit_name2, :function_name2]) do # default processes

    end 35 12೥4݄26೔໦༵೔
  57. scope for controllers scope "UserController" do function :function_name do #

    some processes end end 36 12೥4݄26೔໦༵೔
  58. 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೔໦༵೔
  59. user.unit.comments user.unit.blacklist! User.unit.rank 38 12೥4݄26೔໦༵೔

  60. helper helpers do def hello_world 'hello world' end end #app/chankos/unit_name/views/top/top.html.haml

    = unit.hello_world 39 12೥4݄26೔໦༵೔
  61. Differences from Engine Engine Chanko Objective Overwrite existing application feature

    Provide independent feature Standalone × O Reusability × O Stability O × 40 12೥4݄26೔໦༵೔
  62. Chanko in COOKPAD 41 12೥4݄26೔໦༵೔

  63. PC MOBILE SmartPhone Android app Chanko in COOKPAD 42 12೥4݄26೔໦༵೔

  64. Developed in a year > 200 Currently active units 30

    ~ 40 How many units 43 12೥4݄26೔໦༵೔
  65. Unit manager 44 12೥4݄26೔໦༵೔

  66. Varnish Cache Rails Action Cache Action Bypass Cookie Normal Cache

    45 12೥4݄26೔໦༵೔
  67. Errors 46 12೥4݄26೔໦༵೔

  68. 47 12೥4݄26೔໦༵೔

  69. 47 12೥4݄26೔໦༵೔

  70. 47 12೥4݄26೔໦༵೔

  71. Old New 48 12೥4݄26೔໦༵೔

  72. Chanko https://github.com/cookpad/chanko If you have any questions, tweet at @mrkn

    or @shingo. 49 12೥4݄26೔໦༵೔