SlideShare a Scribd company logo
Rapid Development
    with Rails
About me
•          / xdite

• using Rails since 2007
• http://blog.xdite.net
• xdite@techbang.com.tw
Lead Developer & Manager
• Rails
• Rapid Development with Rails
Ruby on Rails
• Since 2004, DHH from 37 signals
•
  • DRY / Agile / Rapid / Cooooool !!
•
  • Developer /                /        /
           ....
• Developer
•
•
•
...
...
Rapid development with Rails
Developer
•           PHP Developer

•             PHP Developer

•       Convention

•     Developer

•           Rails Developer
•
•
•
•   Developer
•
• Rails 3 > Django > Rails 2 > Zend >
    Symfony >>>>>> CakePHP
•
•                            1M PV /day

•
•
    •   code

    •   Test

    •   Version Control   )

•
Rapid Development?
•5      CRUD

• XXX
•
•
•
•
•
•
Rapid development with Rails
..?
DELIVER
Rapid ?
Rapid development with Rails
FAIL!
•
•
•
•
development model
Rails
Rapid development with Rails
Rapid development with Rails
Rails
•
•
Rails
•
•
Rails
•
•
•
•           =>   =>
•
•
•
•       do better

•   /   solution
Rapid Development ?
Team Development
Rapid development with Rails
•
•
•
•
Team Development
•
•            +          = Team

• Opensource plugin +   = Team
Convention / Practices
Rails
• Community-based best practices
• Continuous revolution
• contributed by top developers
• cutting-edge technologies & ideas running
  on production
• Online training courses provided by Google
Rails
        ....
Rapid development with Rails
{   }
Rails
• Community-based best practices
• Continuous revolution
• contributed by top developers
• cutting-edge technologies & ideas running
  on production
!
Rapid development with Rails
Rails
Scaling Rails by Default
                                     http://slidesha.re/dkJjOB




• Client-side Performance Tuning
• Client-side Performance Tuning
 • CDN
image_tag
http://asset.example.org/photos/small.jpg?1269316198
• Client-side Performance Tuning
 • CDN
 • Minimal HTTP Request
<%= javascript_include_tag :default, :cache => true %>
<%=stylesheet_link_tag “main”, :cache => true %>



http://asset.example.org/javascripts/all.js?1269316198
http://asset.example.org/stylesheets/all.css?1269316198
• Client-side Performance Tuning
 • CDN
 • Minimal HTTP Request
 • Parallel Download
config.action_controller.asset_host                  =
                 “asset%d.example.org”

http://asset1.example.org/javascripts/all.js?1269316198
http://asset2.example.org/javascripts/all.js?1269316198
http://asset3.example.org/javascripts/all.js?1269316198
http://asset4.example.org/javascripts/all.js?1269316198
• Client-side Performance Tuning
 • CDN
 • Minimal HTTP Request
 • Parallel Download
 • Cache Control
def index
  do_somthing
  expires_in 10.minutes
end




header[“Cache-Control”] = “max-age=600”
Scaling Rails by Default
                                     http://slidesha.re/dkJjOB




• Client-side Performance Tunning
 • CDN
 • Minimal HTTP Request
 • Parallel Download
 • Cache Control
 • ETags, Last Modified.....etc
• Common sense of DB tuning
• Common sense of DB tuning
 • Avoid N+1 Query
             using “bullet” plugin , :include => [:comment]
• Common sense of DB tuning
 • Avoid N+1 Query
 • Use Counter Cache
              belongs_to :post, :counter_cache => “true”
• Common sense of DB tuning
 • Avoid N+1 Query
 • Use Counter Cache
 • Use CONSTANT
              CONSTANT will cache in memory
• Common sense of DB tuning
 • Avoid N+1 Query
 • Use Counter Cache
 • Use CONSTANT
 • ADD INDEX
                EXPLAIN every query, avoid table scan
                using “rails_index” plugin
• Common sense of DB tuning
 • Avoid N+1 Query
 • Use Counter Cache
 • Use CONSTANT
 • ADD INDEX
 • SELECT ONLY NEED
                  using “scrooge” plugin replace SELECT *
• Version Control Everything
• Version Control Everything
 • Git cheap branches bring cheap feature
• Version Control Everything
 • Git
 • db migration
        version control db schema
• Version Control Everything
 • Git
 • db migration
 • package management config
       version control package dependency
Gemfile
Available since 2.3.x +
• Version Control Everything
 • Git
 • db migration
 • package management config
 • deployment
        using Capistrano to rollback back each build easily
• Automate Everything
• Automate Everything
 • template
     authentication, permission control, facebook integration, pagination,admin panel,
     seach engine,job worker,mailer....etc.

     rails blog -m ~/template.rb

     rails blog -m http://gist.github.com/31208.txt

     rake rails:template LOCATION=~/template.rb
• Automate Everything
 • template
 • deployment
        * memcached, search engine, mailer, job worker, db migrate....etc.
        * 1 machine, 2+ machines, 10+ machines ....
        * Capistrano auto deployment + Deploy VMs....
• Code Readability
 • OOP / Design Pattern
 • MVC
 • Rails Best Practice               http://bit.ly/fIX3NV


 • Writing Efficiently Ruby Code      http://bit.ly/e0PpPF


 • Writing team own best practices   http://bit.ly/fL6aGI
• Product Quality
 • refactor architecture
 • SEO tuning
 • UI tuning
 • Pageview tuning
 • Business tuning
• Modern Architecture
 • Arel
 • Rack
 • ActiveModel
 • Bundler
• Modern Architecture
 • Arel
   Relational Algebra for Ruby

   simplifies the generation complex of SQL queries

   adapts to various RDBMS systems
Rack   Rack middleware
                                    http://bit.ly/aZiOIs




• Modern Architecture
 • Rack
• Modern Architecture
 • ActiveModel
   Everybody loves ActiveRecord’s feature

                      ActionPack helpers

                      Module

           Naming, Conversion, AttributeMethods, Callback, Dirty,
           MassAssignment Security,Observing,Serialization,Translation
• Modern Architecture
 • Bundler
   1 project have 10-20+ gem / plugins

    A require ‘Z’ v=0.2.1   B require ‘Z’ v=0.1.2 => conflict!

    some plugin only have trunk version, especially when we are in Rails 3.0.0 pre
Gemfile
Available since 2.3.x +
• Modern Architecture
 • Bundler
   Dependency Resolution
   Groups of Dependencies
    support git , branch , tag

    bundle lock
survey
• Compass       Ruby   CSS , CSS module   http://bit.ly/i2XLyZ


• CoffeeScript     Ruby    JavaScript


• TDD / BDD
•           plugin....
• Query Reviwer....etc
just follow Rails !!
•
•
•
Projects
• 2010/04 : T
• 2010/05 : event
• 2010/08 :                     Digiphoto      event

• 2010/09 : event
• 2010/10 : event
• 2010/11 : T
• 2010/12 :         Digiphoto          event

• 2011/03 : R3
Rails Developer
Rapid development with Rails
?
    ...
Rails   ?
            ...
Rapid Development with fun and money
•    Deliver

•                            http://bit.ly/eYfdba




•    (         ) || (    /            )
                             http://bit.ly/dPk7od




•
•
Thanks for listening
http://bit.ly/hDiq72




Burn Rate
http://bit.ly/2UivVg




( Agricola )   Startup / Website
http://blog.xdite.net
Q&A

More Related Content

PDF
Python to go
PPT
Real World Rails Deployment
PDF
[DEISER Day Conferences] "Development Lifecycle Using Atlassian Tools" Juan G...
PDF
從零開始的爬蟲之旅 Crawler from zero
PPTX
Agile sites2
PPTX
Agile sites @ telmore
PDF
Riak at Posterous
PDF
React.js for Rails Developers
Python to go
Real World Rails Deployment
[DEISER Day Conferences] "Development Lifecycle Using Atlassian Tools" Juan G...
從零開始的爬蟲之旅 Crawler from zero
Agile sites2
Agile sites @ telmore
Riak at Posterous
React.js for Rails Developers

What's hot (20)

PDF
Rails on HBase
PPTX
Hire laravel-php-developers- Hire Laravel Programmers
PDF
Adobe AEM for Business Heads
PDF
React server side rendering performance
PDF
Agile sites311training
PDF
Enterprise Integration Patterns with Apache Camel
PPTX
They why behind php frameworks
PDF
The Dark Side of Single Page Applications
PDF
Client Vs. Server Rendering
PPTX
RESTful Services
PPT
Node and Azure
PDF
貢獻開源專案 (Contribute to open source project)
PDF
Productive Rails development with RubyMine
PDF
Masterin Large Scale Java Script Applications
PPTX
Testing your Single Page Application
PPTX
Ci of js and apex using jasmine, phantom js and drone io df14
PDF
Modern javascript
PDF
A Day of REST
PDF
Saigon Ruby Meetup 06/10/2015 - Changeful Gem
PDF
The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...
Rails on HBase
Hire laravel-php-developers- Hire Laravel Programmers
Adobe AEM for Business Heads
React server side rendering performance
Agile sites311training
Enterprise Integration Patterns with Apache Camel
They why behind php frameworks
The Dark Side of Single Page Applications
Client Vs. Server Rendering
RESTful Services
Node and Azure
貢獻開源專案 (Contribute to open source project)
Productive Rails development with RubyMine
Masterin Large Scale Java Script Applications
Testing your Single Page Application
Ci of js and apex using jasmine, phantom js and drone io df14
Modern javascript
A Day of REST
Saigon Ruby Meetup 06/10/2015 - Changeful Gem
The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...
Ad

Viewers also liked (20)

PPT
Rapid Application Development using Ruby on Rails
KEY
Ruby and Rails Packaging to Production
PDF
Rails in docker
PPTX
Deployment Patterns in the Ruby on Rails World
PDF
Package anything with fpm cookery
PDF
Building & Scaling a Front End Practice & Team
PDF
Web Development using Ruby on Rails
PDF
Implementing quality in Java projects
KEY
Wed Development on Rails
PPT
Simple Social Networking with Ruby on Rails
PPTX
Rapid development of pvr cinemas
PPTX
PVR Presentation
PPT
Value Chain Analysis of PVR Ltd.
PPTX
Pvr cinema( Select City Walk, Delhi)...MOHD. ASLAM (MET Faculty of Architecture)
PPTX
Final copy pvr
PPTX
Pvr multiplexes manendra
PPTX
PVR Marketing Strategies
PPT
Be project ppt asp.net
PPT
Pvr Ppt
PDF
SelectCity Walk Mall
Rapid Application Development using Ruby on Rails
Ruby and Rails Packaging to Production
Rails in docker
Deployment Patterns in the Ruby on Rails World
Package anything with fpm cookery
Building & Scaling a Front End Practice & Team
Web Development using Ruby on Rails
Implementing quality in Java projects
Wed Development on Rails
Simple Social Networking with Ruby on Rails
Rapid development of pvr cinemas
PVR Presentation
Value Chain Analysis of PVR Ltd.
Pvr cinema( Select City Walk, Delhi)...MOHD. ASLAM (MET Faculty of Architecture)
Final copy pvr
Pvr multiplexes manendra
PVR Marketing Strategies
Be project ppt asp.net
Pvr Ppt
SelectCity Walk Mall
Ad

Similar to Rapid development with Rails (20)

PDF
Ride on the Fast Track of Web with Ruby on Rails- Part 2
PDF
Rails - getting started
PDF
RubyEnRails2007 - Dr Nic Williams - Keynote
PDF
09 - Fábio Akita - Além do rails
PDF
.NET Architects Day - DNAD 2011
PPT
PDF
Ruby on Rails : 簡介與入門
PPT
Ruby on Rails industry trends
PDF
Rails 3 : Cool New Things
PPT
Ruby On Rails Introduction
DOCX
Rails Concept
KEY
Rails tools
PDF
Slides
ZIP
Rails 3 (beta) Roundup
PDF
Lecture #5 Introduction to rails
PDF
Introduction to Rails by Evgeniy Hinyuk
PDF
Ruby and Rails for womens
KEY
Wider than rails
PDF
Security Goodness with Ruby on Rails
KEY
Ruby On Rails
Ride on the Fast Track of Web with Ruby on Rails- Part 2
Rails - getting started
RubyEnRails2007 - Dr Nic Williams - Keynote
09 - Fábio Akita - Além do rails
.NET Architects Day - DNAD 2011
Ruby on Rails : 簡介與入門
Ruby on Rails industry trends
Rails 3 : Cool New Things
Ruby On Rails Introduction
Rails Concept
Rails tools
Slides
Rails 3 (beta) Roundup
Lecture #5 Introduction to rails
Introduction to Rails by Evgeniy Hinyuk
Ruby and Rails for womens
Wider than rails
Security Goodness with Ruby on Rails
Ruby On Rails

More from Yi-Ting Cheng (18)

PDF
2016 01 09 NPS - 63
PDF
2016 01 07-part2
PDF
2016 01 07 part 1
PDF
Intro to Rails Workshop ( TA 須知 )
PDF
農家樂 Agricola
PDF
莫拉克颱風災情支援網
PDF
Upgrading to rails3
KEY
Ship It ! with Ruby/ Rails Ecosystem
PDF
Scaling Rails Sites by default
PDF
Sinatra Introduction
PDF
OSDC 2009 Rails Turtorial
PDF
Ec2onrails
PDF
Rails21v2
PDF
Pp6-xdite
PDF
Very Xd Hw9
PDF
Very Xd
PDF
Happyweb8 Encode
PDF
Happyweb8 Encode
2016 01 09 NPS - 63
2016 01 07-part2
2016 01 07 part 1
Intro to Rails Workshop ( TA 須知 )
農家樂 Agricola
莫拉克颱風災情支援網
Upgrading to rails3
Ship It ! with Ruby/ Rails Ecosystem
Scaling Rails Sites by default
Sinatra Introduction
OSDC 2009 Rails Turtorial
Ec2onrails
Rails21v2
Pp6-xdite
Very Xd Hw9
Very Xd
Happyweb8 Encode
Happyweb8 Encode

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Advanced IT Governance
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
Teaching material agriculture food technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Machine learning based COVID-19 study performance prediction
Chapter 3 Spatial Domain Image Processing.pdf
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Advanced IT Governance
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Teaching material agriculture food technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
Network Security Unit 5.pdf for BCA BBA.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
“AI and Expert System Decision Support & Business Intelligence Systems”
Review of recent advances in non-invasive hemoglobin estimation
Per capita expenditure prediction using model stacking based on satellite ima...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Machine learning based COVID-19 study performance prediction

Rapid development with Rails

Editor's Notes