Clouds against the Floodsor how Ruby On Rails saved the day in Australia



Leonardo Borges
www.leonardoborges.com
What do I do?
• Write code for ThoughtWorks in Sydney, Australia
• Contribute to open-source projects, on occasion
  - Rails
  - JRuby
  - rcov_plugin
  - Savon
• Blog, rant and cause trouble online
 - www.leonardoborges.com
 - @leonardo_borges
• Get shy in presentations like this one



 Leonardo Borges
 www.leonardoborges.com
What?




Leonardo Borges
www.leonardoborges.com
What?
• 75% of Queensland under water




 Leonardo Borges
 www.leonardoborges.com
What?
• 75% of Queensland under water
• Government to run a telethon on Channel 9




 Leonardo Borges
 www.leonardoborges.com
What?
• 75% of Queensland under water
• Government to run a telethon on Channel 9
• SSQ’s donation app misbehaved




 Leonardo Borges
 www.leonardoborges.com
What?
• 75% of Queensland under water
• Government to run a telethon on Channel 9
• SSQ’s donation app misbehaved
• backup plan?




 Leonardo Borges
 www.leonardoborges.com
We can help!
• ThoughtWorks offered to give a hand
• we were at the beach
• and were pulled in 2 days before the telethon




 Leonardo Borges
 www.leonardoborges.com
How?




Leonardo Borges
www.leonardoborges.com
How?
• Rails, of course




 Leonardo Borges
 www.leonardoborges.com
How?
• Rails, of course
• Deployment options




 Leonardo Borges
 www.leonardoborges.com
How?
• Rails, of course
• Deployment options
   - Amazon EC2




 Leonardo Borges
 www.leonardoborges.com
How?
• Rails, of course
• Deployment options
   - Amazon EC2
   - Heroku




 Leonardo Borges
 www.leonardoborges.com
How?
• Rails, of course
• Deployment options
   - Amazon EC2
   - Heroku




 Leonardo Borges
 www.leonardoborges.com
How?
• Rails, of course
• Deployment options
   - Amazon EC2
   - Heroku
•An awesome team




                          Ben Barnard, me and Phillip Calçado


 Leonardo Borges
 www.leonardoborges.com
The donation app
• form for donor details
• payment gateway integration
• background jobs - sending emails




 Leonardo Borges
 www.leonardoborges.com
The donation app
• form for donor details
• payment gateway integration
• background jobs - sending emails
   - delayed_job gem
   - SMTP capable of sending thousands of emails




 Leonardo Borges
 www.leonardoborges.com
The donation app
• form for donor details
• payment gateway integration
• background jobs - sending emails
   - delayed_job gem
   - SMTP capable of sending thousands of emails




 Leonardo Borges
 www.leonardoborges.com
Monitoring,
Benchmarking &
Caching




Leonardo Borges
www.leonardoborges.com
Monitoring,
Benchmarking &
Caching
• NewRelic




Leonardo Borges
www.leonardoborges.com
Monitoring,
Benchmarking &
Caching
• NewRelic
   - Identifying errors early




 Leonardo Borges
 www.leonardoborges.com
Monitoring,
Benchmarking &
Caching
• NewRelic
   - Identifying errors early
   - Measuring server load and scaling accordingly




 Leonardo Borges
 www.leonardoborges.com
Monitoring,
Benchmarking &
Caching
• NewRelic
   - Identifying errors early
   - Measuring server load and scaling accordingly
• Apache AB




 Leonardo Borges
 www.leonardoborges.com
Monitoring,
Benchmarking &
Caching
• NewRelic
   - Identifying errors early
   - Measuring server load and scaling accordingly
• Apache AB
   - Finding the bottlenecks




 Leonardo Borges
 www.leonardoborges.com
Monitoring,
Benchmarking &
Caching
• NewRelic
   - Identifying errors early
   - Measuring server load and scaling accordingly
• Apache AB
   - Finding the bottlenecks
• Varnish




 Leonardo Borges
 www.leonardoborges.com
Monitoring,
Benchmarking &
Caching
• NewRelic
   - Identifying errors early
   - Measuring server load and scaling accordingly
• Apache AB
   - Finding the bottlenecks
• Varnish
   - Aggressive caching




 Leonardo Borges
 www.leonardoborges.com
Monitoring,
Benchmarking &
Caching
• NewRelic
   - Identifying errors early
   - Measuring server load and scaling accordingly
• Apache AB
   - Finding the bottlenecks
• Varnish
   - Aggressive caching




 Leonardo Borges
 www.leonardoborges.com
Winning over the skepticism




Leonardo Borges
www.leonardoborges.com
Winning over the skepticism
• When we first offered help...
   - Ruby? You can’t do nothing serious with Ruby
   - The schedule is too tight!
   - How are you gonna deploy this thing?




 Leonardo Borges
 www.leonardoborges.com
Winning over the skepticism
• When we first offered help...
   - Ruby? You can’t do nothing serious with Ruby
   - The schedule is too tight!
   - How are you gonna deploy this thing?

• What happened...
   - Their app went down at the start of the telethon
   - Remember the backup plan?




 Leonardo Borges
 www.leonardoborges.com
Winning over the skepticism
• When we first offered help...                          • We developed and deployed an app that...
   - Ruby? You can’t do nothing serious with Ruby          - was built Ruby on Rails
   - The schedule is too tight!                            - scales
   - How are you gonna deploy this thing?                  - integrates with a few external services
                                                           - handled the load comfortably
                                                               - 15 req/sec during the telethon
• What happened...                                             - AUD$ 2 million generated in two hours
   - Their app went down at the start of the telethon      - received over AUD$ 30 million in donations thus far
   - Remember the backup plan?                             - has been the main app since then




 Leonardo Borges
 www.leonardoborges.com
Winning over the skepticism
• When we first offered help...                          • We developed and deployed an app that...
   - Ruby? You can’t do nothing serious with Ruby          - was built Ruby on Rails
   - The schedule is too tight!                            - scales
   - How are you gonna deploy this thing?                  - integrates with a few external services
                                                           - handled the load comfortably
                                                               - 15 req/sec during the telethon
• What happened...                                             - AUD$ 2 million generated in two hours
   - Their app went down at the start of the telethon      - received over AUD$ 30 million in donations thus far
   - Remember the backup plan?                             - has been the main app since then
                                                                                             ... in a little over 48 hours




 Leonardo Borges
 www.leonardoborges.com
Winning over the skepticism
• When we first offered help...                          • We developed and deployed an app that...
   - Ruby? You can’t do nothing serious with Ruby          - was built Ruby on Rails
   - The schedule is too tight!                            - scales
   - How are you gonna deploy this thing?                  - integrates with a few external services
                                                           - handled the load comfortably
                                                               - 15 req/sec during the telethon
• What happened...                                             - AUD$ 2 million generated in two hours
   - Their app went down at the start of the telethon      - received over AUD$ 30 million in donations thus far
   - Remember the backup plan?                             - has been the main app since then
                                                                                             ... in a little over 48 hours




 Leonardo Borges
 www.leonardoborges.com
Resources
• rubyonrails.org
• fragmental.tw - Phillip Calçado
• heroku.com
• sendgrid.com
• newrelic.com
• httpd.apache.org/docs/2.0/programs/ab.html
• github.com/collectiveidea/delayed_job




 Leonardo Borges
 www.leonardoborges.com
Q&A




Leonardo Borges
www.leonardoborges.com
Thank you!




Leonardo Borges
www.leonardoborges.com

Clouds Against the Floods

  • 1.
    Clouds against theFloodsor how Ruby On Rails saved the day in Australia Leonardo Borges www.leonardoborges.com
  • 2.
    What do Ido? • Write code for ThoughtWorks in Sydney, Australia • Contribute to open-source projects, on occasion - Rails - JRuby - rcov_plugin - Savon • Blog, rant and cause trouble online - www.leonardoborges.com - @leonardo_borges • Get shy in presentations like this one Leonardo Borges www.leonardoborges.com
  • 3.
  • 4.
    What? • 75% ofQueensland under water Leonardo Borges www.leonardoborges.com
  • 5.
    What? • 75% ofQueensland under water • Government to run a telethon on Channel 9 Leonardo Borges www.leonardoborges.com
  • 6.
    What? • 75% ofQueensland under water • Government to run a telethon on Channel 9 • SSQ’s donation app misbehaved Leonardo Borges www.leonardoborges.com
  • 7.
    What? • 75% ofQueensland under water • Government to run a telethon on Channel 9 • SSQ’s donation app misbehaved • backup plan? Leonardo Borges www.leonardoborges.com
  • 8.
    We can help! •ThoughtWorks offered to give a hand • we were at the beach • and were pulled in 2 days before the telethon Leonardo Borges www.leonardoborges.com
  • 9.
  • 10.
    How? • Rails, ofcourse Leonardo Borges www.leonardoborges.com
  • 11.
    How? • Rails, ofcourse • Deployment options Leonardo Borges www.leonardoborges.com
  • 12.
    How? • Rails, ofcourse • Deployment options - Amazon EC2 Leonardo Borges www.leonardoborges.com
  • 13.
    How? • Rails, ofcourse • Deployment options - Amazon EC2 - Heroku Leonardo Borges www.leonardoborges.com
  • 14.
    How? • Rails, ofcourse • Deployment options - Amazon EC2 - Heroku Leonardo Borges www.leonardoborges.com
  • 15.
    How? • Rails, ofcourse • Deployment options - Amazon EC2 - Heroku •An awesome team Ben Barnard, me and Phillip Calçado Leonardo Borges www.leonardoborges.com
  • 16.
    The donation app •form for donor details • payment gateway integration • background jobs - sending emails Leonardo Borges www.leonardoborges.com
  • 17.
    The donation app •form for donor details • payment gateway integration • background jobs - sending emails - delayed_job gem - SMTP capable of sending thousands of emails Leonardo Borges www.leonardoborges.com
  • 18.
    The donation app •form for donor details • payment gateway integration • background jobs - sending emails - delayed_job gem - SMTP capable of sending thousands of emails Leonardo Borges www.leonardoborges.com
  • 19.
  • 20.
  • 21.
    Monitoring, Benchmarking & Caching • NewRelic - Identifying errors early Leonardo Borges www.leonardoborges.com
  • 22.
    Monitoring, Benchmarking & Caching • NewRelic - Identifying errors early - Measuring server load and scaling accordingly Leonardo Borges www.leonardoborges.com
  • 23.
    Monitoring, Benchmarking & Caching • NewRelic - Identifying errors early - Measuring server load and scaling accordingly • Apache AB Leonardo Borges www.leonardoborges.com
  • 24.
    Monitoring, Benchmarking & Caching • NewRelic - Identifying errors early - Measuring server load and scaling accordingly • Apache AB - Finding the bottlenecks Leonardo Borges www.leonardoborges.com
  • 25.
    Monitoring, Benchmarking & Caching • NewRelic - Identifying errors early - Measuring server load and scaling accordingly • Apache AB - Finding the bottlenecks • Varnish Leonardo Borges www.leonardoborges.com
  • 26.
    Monitoring, Benchmarking & Caching • NewRelic - Identifying errors early - Measuring server load and scaling accordingly • Apache AB - Finding the bottlenecks • Varnish - Aggressive caching Leonardo Borges www.leonardoborges.com
  • 27.
    Monitoring, Benchmarking & Caching • NewRelic - Identifying errors early - Measuring server load and scaling accordingly • Apache AB - Finding the bottlenecks • Varnish - Aggressive caching Leonardo Borges www.leonardoborges.com
  • 28.
    Winning over theskepticism Leonardo Borges www.leonardoborges.com
  • 29.
    Winning over theskepticism • When we first offered help... - Ruby? You can’t do nothing serious with Ruby - The schedule is too tight! - How are you gonna deploy this thing? Leonardo Borges www.leonardoborges.com
  • 30.
    Winning over theskepticism • When we first offered help... - Ruby? You can’t do nothing serious with Ruby - The schedule is too tight! - How are you gonna deploy this thing? • What happened... - Their app went down at the start of the telethon - Remember the backup plan? Leonardo Borges www.leonardoborges.com
  • 31.
    Winning over theskepticism • When we first offered help... • We developed and deployed an app that... - Ruby? You can’t do nothing serious with Ruby - was built Ruby on Rails - The schedule is too tight! - scales - How are you gonna deploy this thing? - integrates with a few external services - handled the load comfortably - 15 req/sec during the telethon • What happened... - AUD$ 2 million generated in two hours - Their app went down at the start of the telethon - received over AUD$ 30 million in donations thus far - Remember the backup plan? - has been the main app since then Leonardo Borges www.leonardoborges.com
  • 32.
    Winning over theskepticism • When we first offered help... • We developed and deployed an app that... - Ruby? You can’t do nothing serious with Ruby - was built Ruby on Rails - The schedule is too tight! - scales - How are you gonna deploy this thing? - integrates with a few external services - handled the load comfortably - 15 req/sec during the telethon • What happened... - AUD$ 2 million generated in two hours - Their app went down at the start of the telethon - received over AUD$ 30 million in donations thus far - Remember the backup plan? - has been the main app since then ... in a little over 48 hours Leonardo Borges www.leonardoborges.com
  • 33.
    Winning over theskepticism • When we first offered help... • We developed and deployed an app that... - Ruby? You can’t do nothing serious with Ruby - was built Ruby on Rails - The schedule is too tight! - scales - How are you gonna deploy this thing? - integrates with a few external services - handled the load comfortably - 15 req/sec during the telethon • What happened... - AUD$ 2 million generated in two hours - Their app went down at the start of the telethon - received over AUD$ 30 million in donations thus far - Remember the backup plan? - has been the main app since then ... in a little over 48 hours Leonardo Borges www.leonardoborges.com
  • 34.
    Resources • rubyonrails.org • fragmental.tw- Phillip Calçado • heroku.com • sendgrid.com • newrelic.com • httpd.apache.org/docs/2.0/programs/ab.html • github.com/collectiveidea/delayed_job Leonardo Borges www.leonardoborges.com
  • 35.
  • 36.