SlideShare a Scribd company logo
Rails   B2B

                             @freewheel.tv   @freewheel.tv
                                                  2012.04

© FreeWheel 2011
!  FreeWheel

! 

!  Rails FreeWheel

!  Rails

! 
FreeWheel   !
What does FreeWheel do?

• 
• 
•            30%
     • 
     •    comScore
What is MRM/RPM?



         •  Monetization Rights Management®
           • 



         •  Revenue & Payments Management®
           • 




                                              6
!
FreeWheel MRM


  Ad#Tag#/#Request              Ad#Manager                    Video#Metadata




 MRM
        Ad#Server                 Ad#Server

        Ad#Server                 Ad#Server


                                              DB:#OLTP/OLAP   UI/API:#Adver-sing/Inventory
        Log#Files

                     ETL#Repor-ng




                    Inventory#Forecast




                                                                                             9
Technology Stacks
Integration             Flash&(AS2/AS3)&          iPhone/iPad&(ObjAC)&               HTML5&/&JavaScript&

                                                    Android&(Java)&                   Silverlight&(C#)&


Service                                                                                                               Quality
   BUSINESS&INTELLIGENCE&                                             MRM/RPM:&UI/API                     #               Cucumber
               &                                                      (RoR,#jQuery,#Java)             Analy-cs##
                                             Ad&Server&
        ETL&ReporQng&                                                                              (MicroStrategy)
                                               (C++)                                                                      Selenium
          Forecast&
 (Map#Reduce#like,#C++,#Python)
                                                                                                                         Log&Replay
                                                                                                          #
                Management&&&Monitor&Portal&                             BVI/BII/Data&
                                                                                                        Search##
                  (Python,#jQuery,#SQLite)                                 Manager
                                                                                                    (Lucene#/#Solr)
                                                                          (Ruby,#etc.)                                  REGRESSION    &
                                                                                                                        MRM/RPM&UI      &
                                                                                                                             VI&
     Message#Queue(ZMQ)                    Cache#/#Fast#Storage#(Memcached/                          #
                                                                                                                          Ad&Server &
                                                  LevelDB/MongoDB)                           OLAP#(Infobright)
                                                                                                                        ETL&ReporQng
                                                                                                                          Forecast&
  Task#Scheduler#(crontab,#etc)                                       OLTP#(MySQL)                                      Rules&Engine  &



Infrastructure
           SYSTEM&                                 STORAGE&                                 NETWORKING&
     Mostly#Linux#(RHEL#5)                         SAN#+#NAS                                 LB#/#Akamai




                                                                                                                                            10
Open Source Building Blocks




                              11
• 
     • 
•             Uptime: 99.99%
     • 
     • 
     • 
• 
     • 
     •    Insight
• 
     •    +
• 
     • 



                               12
•  Since 2010
• 
  •  S.W.A.T team
  •  Top Guns/Code Monkeys
•                    !
•  DevOps:




                             13
UI
 •  RPM+MRM UI
 • 
      •  Ruby on Rails + Sinatra
      •       JS/CSS
 • 
      • 
      • 
      • 
      • 
      •  …
 • 



                                   14
Rails   FreeWheel   !
Rails

 !  2007 7   Rails 1.2.3

 !  MRM UI




                           Rails       
   

                                   

!




    17
Quick-and-Dirty

 !                Business Driven
   ! 

   !  B2B

 !  Release
   !        5~6           Release

   !          Point Release Bugfix

 ! “                 ”
   !  Rails

   !              Best Practice
Rails         “       ”

 !  Rails                        !
      !                              !
      !  “   ” workaround

 !  Fat Model
      !              !
      !                          !
      !  Validations Callbacks   !

 !           View
      !           Partial
      !  RHTML/HAML/ERB JavaScript
UI   !




         20
Rails
!  Rails1.2 (March, 2007) => Rails3.0 (April, 2011)




  !  Bundle Scopes I18N Rack-based Middleware…

  !  MRM RPM                          !

!  Rails3.1      Asset Pipeline

!  JavaScript
  !  jQuery 1.2 => jQuery 1.4.4

  !     jQuery-UI Widgets
Rails3.0

 !  3 Release 12

 !  LoC in Branch

      # Commits          LoC         LoC(Exclude Vendor)


           344      +69322, -62147     +41559, 43750




 !  LoC in Trunk

      # Commits          LoC

        592         +13137, -11324
!                   SSO                                               API                       …
!  Module              Mini Rails

!  Application                              Module           Bundled APP


          Module                            Module                            Module
          Resources                         Resources                         Resources
     C     Biz Logic                 C        Biz Logic               C         Biz Logic
                            A                               A                               A
     O                               O                                O
     N   View/Helper        P
                                     N      View/Helper     P
                                                                      N       View/Helper   P
                            I                               I                               I
     F    Controller                 F       Controller               F        Controller
            Model                              Model                             Model



          SSO          User Permission     System API (Search, i18n, …)          Tasks
         Shared Model       Controller/Dispatcher    View/Helper            BizLogic
             Shared 3rd Plugins            Components              Shared Resources
!



    mount                   Module
                                !




                    Gem          Module   !




       Asset Pipeline                     Modul
                        e    !




                                                  25
Business Model

!                                       Let Model be DAO
 !  ActiveRecord Model                   Business Logic

 !        Active Record Callbacks Validations

     Rails MVC with Business Model
                    AcQon&View                            Widgets&


                  AcQon&Controller



                   Business&Model&                  Business&Scenario&



          AcQveRecord            AcQveRecord
— Model   !
                           Validation
                       !



              1.
              Validation



              2.

              validation if/else
                        !

              3.
                      Model
                         LoC>2k)!




                                   27
— Business Model   !
                            Business Model

                                  Validation

                       1.

                              “   ”


                       2.

                       Business Model

                       3.            Business
                       Model
                          Business Model




                                               28
Widgets

 !                  MVC
  !                            jQuery jQuery UI

  !  JSON + Restful

  ! 
      ! 

      !  Grid, Tab, Calendar, Layout, Accordion, Wizard, Dropdown…

  ! 
      ! 

      ! 

      ! 
Widgets           !

    Widgets


              AdProduct               ContentTargeting            Schedule



               Budget                     GeoTargeting             ... ...




   Components

                                                                       AdvancedS
      Base                Grid            Toolbar          Form
                                                                         earch




        Lang                     jQuery                  I18n                FW Core




                                                                                       30
Widget   -   !




                 31
Widget—       !

                  FormWidget




                               Field
          !


                                       32
Widget—   !




                       !




              Widget



                       33
Widgets   !




              34
Unicorn +

 !               Lighttpd + FastCGI

 !  Unicorn
      –  An HTTP server with 2k+ lines of pure ruby code
      –  Better memory control by shared memory, forking
      –  Copy-on-write with REE 1.8.7
      –         (Twitter, Github…)
!  DCI Data, context and interaction                           !

! 

!            !
  !              !

  !  CSS           !

!  FreeWheel UI                        !
  !                                                    !

  !                    !



       Multitenant Architecture   Easy Customization   Better Access
02s0102基于rails的大型b2 b系统架构优化   于冰赵晓锋
02s0102基于rails的大型b2 b系统架构优化   于冰赵晓锋
02s0102基于rails的大型b2 b系统架构优化   于冰赵晓锋
02s0102基于rails的大型b2 b系统架构优化   于冰赵晓锋

More Related Content

Similar to 02s0102基于rails的大型b2 b系统架构优化 于冰赵晓锋

[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.com[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.com
Mitch Okamoto
 
Plugin-able POS Solutions by Javascript @HDM9 Taiwan
Plugin-able POS Solutions by Javascript @HDM9 TaiwanPlugin-able POS Solutions by Javascript @HDM9 Taiwan
Plugin-able POS Solutions by Javascript @HDM9 Taiwan
Rack Lin
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
Wen-Tien Chang
 
At&T Interactive: The Many Facets Of Ruby
At&T Interactive: The Many Facets Of RubyAt&T Interactive: The Many Facets Of Ruby
At&T Interactive: The Many Facets Of Ruby
Coby Randquist
 
Ruby on rails探索
Ruby on rails探索Ruby on rails探索
Ruby on rails探索
Mu Chun Wang
 
.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011.NET Architects Day - DNAD 2011
.NET Architects Day - DNAD 2011
Fabio 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 rails
DNAD
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The Enterprise
Matt Aimonetti
 
digitalSTROM Server Development
digitalSTROM Server DevelopmentdigitalSTROM Server Development
digitalSTROM Server Development
digitalSTROM.org
 
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginnerRuby on Rails workshop for beginner
Ruby on Rails workshop for beginner
Umair Amjad
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
Shaer Hassan
 
GTUG JS will save us all
GTUG JS will save us allGTUG JS will save us all
GTUG JS will save us all
Mário Valente
 
Introducing spring
Introducing springIntroducing spring
Introducing spring
Ernesto Hernández Rodríguez
 
Salesforce & SAP Integration
Salesforce & SAP IntegrationSalesforce & SAP Integration
Salesforce & SAP Integration
Raymond Gao
 
Web application intro
Web application introWeb application intro
Web application intro
Tobias Pfeiffer
 
Build Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVMBuild Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVM
National Cheng Kung University
 
Why Cloud Management Makes Sense - Josh Fraser
Why Cloud Management Makes Sense - Josh FraserWhy Cloud Management Makes Sense - Josh Fraser
Why Cloud Management Makes Sense - Josh Fraser
Amazon Web Services
 
Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)
Tobias Pfeiffer
 
Peter Cipov - Coe - od monolitu k mikroslužbám
Peter Cipov - Coe - od monolitu k mikroslužbámPeter Cipov - Coe - od monolitu k mikroslužbám
Peter Cipov - Coe - od monolitu k mikroslužbám
Develcz
 
Threads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionThreads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java edition
Ovidiu Dimulescu
 

Similar to 02s0102基于rails的大型b2 b系统架构优化 于冰赵晓锋 (20)

[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.com[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.com
 
Plugin-able POS Solutions by Javascript @HDM9 Taiwan
Plugin-able POS Solutions by Javascript @HDM9 TaiwanPlugin-able POS Solutions by Javascript @HDM9 Taiwan
Plugin-able POS Solutions by Javascript @HDM9 Taiwan
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
At&T Interactive: The Many Facets Of Ruby
At&T Interactive: The Many Facets Of RubyAt&T Interactive: The Many Facets Of Ruby
At&T Interactive: The Many Facets Of Ruby
 
Ruby on rails探索
Ruby on rails探索Ruby on rails探索
Ruby on rails探索
 
.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
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The Enterprise
 
digitalSTROM Server Development
digitalSTROM Server DevelopmentdigitalSTROM Server Development
digitalSTROM Server Development
 
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginnerRuby on Rails workshop for beginner
Ruby on Rails workshop for beginner
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
 
GTUG JS will save us all
GTUG JS will save us allGTUG JS will save us all
GTUG JS will save us all
 
Introducing spring
Introducing springIntroducing spring
Introducing spring
 
Salesforce & SAP Integration
Salesforce & SAP IntegrationSalesforce & SAP Integration
Salesforce & SAP Integration
 
Web application intro
Web application introWeb application intro
Web application intro
 
Build Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVMBuild Programming Language Runtime with LLVM
Build Programming Language Runtime with LLVM
 
Why Cloud Management Makes Sense - Josh Fraser
Why Cloud Management Makes Sense - Josh FraserWhy Cloud Management Makes Sense - Josh Fraser
Why Cloud Management Makes Sense - Josh Fraser
 
Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)Web application intro + a bit of ruby (revised)
Web application intro + a bit of ruby (revised)
 
Peter Cipov - Coe - od monolitu k mikroslužbám
Peter Cipov - Coe - od monolitu k mikroslužbámPeter Cipov - Coe - od monolitu k mikroslužbám
Peter Cipov - Coe - od monolitu k mikroslužbám
 
Threads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionThreads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java edition
 

Recently uploaded

Best Digital Marketing Strategy Build Your Online Presence 2024.pptx
Best Digital Marketing Strategy Build  Your Online Presence 2024.pptxBest Digital Marketing Strategy Build  Your Online Presence 2024.pptx
Best Digital Marketing Strategy Build Your Online Presence 2024.pptx
pavankumarpayexelsol
 
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
3vgr39kx
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
k7nm6tk
 
定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样
qo1as76n
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
PabloMartelLpez
 
一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样
k4krdgxx
 
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
67n7f53
 
NHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree TranscriptNHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree Transcript
lhtvqoag
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
Jaime Brown
 
Introduction to User experience design for beginner
Introduction to User experience design for beginnerIntroduction to User experience design for beginner
Introduction to User experience design for beginner
ellemjani
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
Bianca Woods
 
LGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation TemplateLGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation Template
DakshGudwani
 
modular-kitchen home plan civil engineering.pdf
modular-kitchen home plan civil engineering.pdfmodular-kitchen home plan civil engineering.pdf
modular-kitchen home plan civil engineering.pdf
RashmitaSwain3
 
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHINHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
NishantRathi18
 
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Designforuminternational
 
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
ijk38lw
 
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
wkip62b
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
talaatahm
 
ADESGN3S_Case-Study-Municipal-Health-Center.pdf
ADESGN3S_Case-Study-Municipal-Health-Center.pdfADESGN3S_Case-Study-Municipal-Health-Center.pdf
ADESGN3S_Case-Study-Municipal-Health-Center.pdf
GregMichaelTapawan
 
Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)
bagmai
 

Recently uploaded (20)

Best Digital Marketing Strategy Build Your Online Presence 2024.pptx
Best Digital Marketing Strategy Build  Your Online Presence 2024.pptxBest Digital Marketing Strategy Build  Your Online Presence 2024.pptx
Best Digital Marketing Strategy Build Your Online Presence 2024.pptx
 
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
 
定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
 
一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样
 
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
一比一原版(CSU毕业证书)查尔斯特大学毕业证如何办理
 
NHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree TranscriptNHL Stenden University of Applied Sciences Diploma Degree Transcript
NHL Stenden University of Applied Sciences Diploma Degree Transcript
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
 
Introduction to User experience design for beginner
Introduction to User experience design for beginnerIntroduction to User experience design for beginner
Introduction to User experience design for beginner
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
 
LGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation TemplateLGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation Template
 
modular-kitchen home plan civil engineering.pdf
modular-kitchen home plan civil engineering.pdfmodular-kitchen home plan civil engineering.pdf
modular-kitchen home plan civil engineering.pdf
 
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHINHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
 
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
Discovering the Best Indian Architects A Spotlight on Design Forum Internatio...
 
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
 
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理一比一原版布兰登大学毕业证(BU毕业证书)如何办理
一比一原版布兰登大学毕业证(BU毕业证书)如何办理
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
 
ADESGN3S_Case-Study-Municipal-Health-Center.pdf
ADESGN3S_Case-Study-Municipal-Health-Center.pdfADESGN3S_Case-Study-Municipal-Health-Center.pdf
ADESGN3S_Case-Study-Municipal-Health-Center.pdf
 
Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)
 

02s0102基于rails的大型b2 b系统架构优化 于冰赵晓锋

  • 1. Rails B2B @freewheel.tv @freewheel.tv 2012.04 © FreeWheel 2011
  • 2. !  FreeWheel !  !  Rails FreeWheel !  Rails ! 
  • 4. What does FreeWheel do? •  •  •  30% •  •  comScore
  • 5.
  • 6. What is MRM/RPM? •  Monetization Rights Management® •  •  Revenue & Payments Management® •  6
  • 7.
  • 8. !
  • 9. FreeWheel MRM Ad#Tag#/#Request Ad#Manager Video#Metadata MRM Ad#Server Ad#Server Ad#Server Ad#Server DB:#OLTP/OLAP UI/API:#Adver-sing/Inventory Log#Files ETL#Repor-ng Inventory#Forecast 9
  • 10. Technology Stacks Integration Flash&(AS2/AS3)& iPhone/iPad&(ObjAC)& HTML5&/&JavaScript& Android&(Java)& Silverlight&(C#)& Service Quality BUSINESS&INTELLIGENCE& MRM/RPM:&UI/API # Cucumber & (RoR,#jQuery,#Java) Analy-cs## Ad&Server& ETL&ReporQng& (MicroStrategy) (C++) Selenium Forecast& (Map#Reduce#like,#C++,#Python) Log&Replay # Management&&&Monitor&Portal& BVI/BII/Data& Search## (Python,#jQuery,#SQLite) Manager (Lucene#/#Solr) (Ruby,#etc.) REGRESSION & MRM/RPM&UI & VI& Message#Queue(ZMQ) Cache#/#Fast#Storage#(Memcached/ # Ad&Server & LevelDB/MongoDB) OLAP#(Infobright) ETL&ReporQng Forecast& Task#Scheduler#(crontab,#etc) OLTP#(MySQL) Rules&Engine & Infrastructure SYSTEM& STORAGE& NETWORKING& Mostly#Linux#(RHEL#5) SAN#+#NAS LB#/#Akamai 10
  • 11. Open Source Building Blocks 11
  • 12. •  •  •  Uptime: 99.99% •  •  •  •  •  •  Insight •  •  + •  •  12
  • 13. •  Since 2010 •  •  S.W.A.T team •  Top Guns/Code Monkeys •  ! •  DevOps: 13
  • 14. UI •  RPM+MRM UI •  •  Ruby on Rails + Sinatra •  JS/CSS •  •  •  •  •  •  … •  14
  • 15. Rails FreeWheel !
  • 16. Rails !  2007 7 Rails 1.2.3 !  MRM UI Rails 
 
 

  • 17. ! 17
  • 18. Quick-and-Dirty !  Business Driven !  !  B2B !  Release !  5~6 Release !  Point Release Bugfix ! “ ” !  Rails !  Best Practice
  • 19. Rails “ ” !  Rails ! !  ! !  “ ” workaround !  Fat Model !  ! !  ! !  Validations Callbacks ! !  View !  Partial !  RHTML/HAML/ERB JavaScript
  • 20. UI ! 20
  • 21. Rails
  • 22. !  Rails1.2 (March, 2007) => Rails3.0 (April, 2011) !  Bundle Scopes I18N Rack-based Middleware… !  MRM RPM ! !  Rails3.1 Asset Pipeline !  JavaScript !  jQuery 1.2 => jQuery 1.4.4 !  jQuery-UI Widgets
  • 23. Rails3.0 !  3 Release 12 !  LoC in Branch # Commits LoC LoC(Exclude Vendor) 344 +69322, -62147 +41559, 43750 !  LoC in Trunk # Commits LoC 592 +13137, -11324
  • 24. !  SSO API … !  Module Mini Rails !  Application Module Bundled APP Module Module Module Resources Resources Resources C Biz Logic C Biz Logic C Biz Logic A A A O O O N View/Helper P N View/Helper P N View/Helper P I I I F Controller F Controller F Controller Model Model Model SSO User Permission System API (Search, i18n, …) Tasks Shared Model Controller/Dispatcher View/Helper BizLogic Shared 3rd Plugins Components Shared Resources
  • 25. ! mount Module ! Gem Module ! Asset Pipeline Modul e ! 25
  • 26. Business Model !  Let Model be DAO !  ActiveRecord Model Business Logic !  Active Record Callbacks Validations Rails MVC with Business Model AcQon&View Widgets& AcQon&Controller Business&Model& Business&Scenario& AcQveRecord AcQveRecord
  • 27. — Model ! Validation ! 1. Validation 2. validation if/else ! 3. Model LoC>2k)! 27
  • 28. — Business Model ! Business Model Validation 1. “ ” 2. Business Model 3. Business Model Business Model 28
  • 29. Widgets !  MVC !  jQuery jQuery UI !  JSON + Restful !  !  !  Grid, Tab, Calendar, Layout, Accordion, Wizard, Dropdown… !  !  !  ! 
  • 30. Widgets ! Widgets AdProduct ContentTargeting Schedule Budget GeoTargeting ... ... Components AdvancedS Base Grid Toolbar Form earch Lang jQuery I18n FW Core 30
  • 31. Widget - ! 31
  • 32. Widget— ! FormWidget Field ! 32
  • 33. Widget— ! ! Widget 33
  • 34. Widgets ! 34
  • 35. Unicorn + !  Lighttpd + FastCGI !  Unicorn –  An HTTP server with 2k+ lines of pure ruby code –  Better memory control by shared memory, forking –  Copy-on-write with REE 1.8.7 –  (Twitter, Github…)
  • 36.
  • 37. !  DCI Data, context and interaction ! !  !  ! !  ! !  CSS ! !  FreeWheel UI ! !  ! !  ! Multitenant Architecture Easy Customization Better Access