Slide 1

Slide 1 text

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೔໦༵೔

Slide 2

Slide 2 text

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೔໦༵೔

Slide 3

Slide 3 text

3 12೥4݄26೔໦༵೔

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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೔໦༵೔

Slide 12

Slide 12 text

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೔໦༵೔

Slide 13

Slide 13 text

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೔໦༵೔

Slide 14

Slide 14 text

Chanko http://www.flickr.com/photos/june29/3396011694/ 5 12೥4݄26೔໦༵೔

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

OVERVIEW 7 12೥4݄26೔໦༵೔

Slide 17

Slide 17 text

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೔໦༵೔

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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೔໦༵೔

Slide 21

Slide 21 text

Implement Bomb 11 12೥4݄26೔໦༵೔

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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೔໦༵೔

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

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೔໦༵೔

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

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೔໦༵೔

Slide 42

Slide 42 text

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೔໦༵೔

Slide 43

Slide 43 text

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೔໦༵೔

Slide 44

Slide 44 text

Invoking a function # app/views/recipes/_header.html.haml = render ‘recipes/search’ 27 12೥4݄26೔໦༵೔

Slide 45

Slide 45 text

Invoking a function # app/views/recipes/_header.html.haml = invoke(:new_search_btn, :search_btn) do = render ‘recipes/search’ 28 12೥4݄26೔໦༵೔

Slide 46

Slide 46 text

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೔໦༵೔

Slide 47

Slide 47 text

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೔໦༵೔

Slide 48

Slide 48 text

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೔໦༵೔

Slide 49

Slide 49 text

Staff Users 30 12೥4݄26೔໦༵೔

Slide 50

Slide 50 text

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

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

invoke(:unit_name, :register_name) invoke method class ApplicationController include Chanko::Invoker end 33 12೥4݄26೔໦༵೔

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

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೔໦༵೔

Slide 56

Slide 56 text

invoke method invoke([:unit_name, :function_name], [:unit_name2, :function_name2]) do # default processes end 35 12೥4݄26೔໦༵೔

Slide 57

Slide 57 text

scope for controllers scope "UserController" do function :function_name do # some processes end end 36 12೥4݄26೔໦༵೔

Slide 58

Slide 58 text

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೔໦༵೔

Slide 59

Slide 59 text

user.unit.comments user.unit.blacklist! User.unit.rank 38 12೥4݄26೔໦༵೔

Slide 60

Slide 60 text

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೔໦༵೔

Slide 61

Slide 61 text

Differences from Engine Engine Chanko Objective Overwrite existing application feature Provide independent feature Standalone × O Reusability × O Stability O × 40 12೥4݄26೔໦༵೔

Slide 62

Slide 62 text

Chanko in COOKPAD 41 12೥4݄26೔໦༵೔

Slide 63

Slide 63 text

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

Slide 64

Slide 64 text

Developed in a year > 200 Currently active units 30 ~ 40 How many units 43 12೥4݄26೔໦༵೔

Slide 65

Slide 65 text

Unit manager 44 12೥4݄26೔໦༵೔

Slide 66

Slide 66 text

Varnish Cache Rails Action Cache Action Bypass Cookie Normal Cache 45 12೥4݄26೔໦༵೔

Slide 67

Slide 67 text

Errors 46 12೥4݄26೔໦༵೔

Slide 68

Slide 68 text

47 12೥4݄26೔໦༵೔

Slide 69

Slide 69 text

47 12೥4݄26೔໦༵೔

Slide 70

Slide 70 text

47 12೥4݄26೔໦༵೔

Slide 71

Slide 71 text

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

Slide 72

Slide 72 text

Chanko https://github.com/cookpad/chanko If you have any questions, tweet at @mrkn or @shingo. 49 12೥4݄26೔໦༵೔