SlideShare a Scribd company logo
Rails
4


       / Takayuki Kyowa

    Kakaku.com,Inc
About me
• @tkyowa /
• 2007 3
    • Rails
•
• tabepad      3
    •
•                  (tkbb)
•
• iPhone
• Ruby 1.9.2 / Rails 3.0
 • Web
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
About tabelog


•
• 4 5000 PV 2900 UU / month (PC + Mobile)
•                Rails
• Rails 2.3 / Ruby 1.8.6
Alexa Ranking
    vs Cookpad
Alexa Ranking
    vs Cookpad
About tabelog


•
• 4 5000 PV 2900 UU / month (PC + Mobile)
•                Rails
• Rails 2.3 / Ruby 1.8.6
About tabelog


•
• 4 5000 PV 2900 UU / month (PC + Mobile)
•                Rails
• Rails 2.3 / Ruby 1.8.6
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
•
•
•
•
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
TiDD

•
    •         2
    •
•
    • No Ticket , No Commit
        •
    •
Workflow
  new
                        Development
assigned   in_work    committed

                             Testing
 ready      tested     checked

                            Release
deployed   released     closed
Problem

•                  2
•
    •
    •
•

    • Redmine Plugin
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
Redmine Plugin
•

•
    •
        • False Negative → False Positive
    •
    •
Future
•
    •
• Git
    •
    •
•
    •
•
•
Architecture
                                   Load Balancer



                 PC                                 Mobile

                      Front                              Front



      PC                           BOT                           Mobile
        Application                 Application                     Application




                         PC                        BOT                    Mobile

Master DB               Slave DB                   Slave DB                Slave DB
Architecture

•   Ruby 1.8.6
•   Rails 2.3
•   Passenger 3.0
•   BackgrounDRb / TabelogAsync
•   MySQL 5.1
•   memcached
•   FAST(Full Text Searcher)
•   Solr, MongoDB
Architecture



•             Web
    •
•
    •
2007.10

 PV    3000      4    5000   1500%

Code   2             10      500%

       30         300        1000%

       25         800        3200%
2007.10

PV     3000      4    5000   1500%

Code   2             10      500%

       30         300        1000%

       25         800        3200%
10
10
10

• Fat Model
10

• Fat Model
• Fat Controller
10

• Fat Model
• Fat Controller
•Fat Helper
10

• Fat Model
• Fat Controller
•Fat Helper
•Fat View
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
.
API


Controller

 Helper

  View

  Model

 Library

  Rails
•           Rails
    •
•
    •
        •           …
    •
        •
Controller   Helper        Controller    Helper

  View       Model             View      Model

 Library      Rails            Library    Rails




Controller   Helper

  View       Model

 Library      Rails
                      ...etc
- Howto
•            →   →   →     → OK!

    •                     orz
•
    •
        •
•
    • View
•
- Result

• Pros
  •
 •
 •
• Cons
  •
     •
 •
2.
ActiveRecord
MVC

          Controller




Model                        View




RDB     Searcher       KVS      Web API
MVC - Rails
                           ActionController
                  Controller


ActiveRecord                         ActionView
     Model                           View




      RDB       Searcher       KVS      Web API
ActiveRecord

• Model ORM
 •
• Controller
• Model         Confusing
• View     AR
• RDB
Backend Divide - PHASE
                              ActionController
                     Controller


Tabelog::Service                        ActionView
      Model                             View



ActiveRecord

      RDB          Searcher       KVS      Web API
Backend Divide - PHASE
• ActiveRecord Model
• Controller/View
 •                   RDB


• ActiveRecord ORM
• Tabelog::Service
  •
• Controller
Backend Divide - PHASE 2

            Frontend-App


                  HTTP



            Backend-App



RDB    Searcher          KVS   Web API
Backend Divide - PHASE 2
Rails
(without ActiveRecord)
                              Frontend-App
              Cobqlo::Requester
                                    HTTP


Cobqlo
(Tabelog’s Framework)         Backend-App



        RDB              Searcher          KVS   Web API
Backend Divide - PHASE 2
•
    •                          API
• Cobqlo
    •       API
        • EventMachine
        • JSON/MessagePack
•                      Cobqlo::Requester
    •                 HTTP
Backend Divide -
•             2
•         Rails
    •     API
    •
    •
• Rails 3.0
    • ActiveModel Arel
•         Rails 3.0
Rails

• Rails

    •              ≒
    •
•                      Java
    • Rails
        • PofEAA
Rails       2

• Rails 3
    • Modularity
    • Pluggable
•
•
•
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会
Any questions?

More Related Content

大規模環境でRailsと4年間付き合ってきて@ クックパッド * 食べログ合同勉強会

Editor's Notes