Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Clouds against the Floods (RubyConfBR2011)

Clouds against the Floods (RubyConfBR2011)

Avatar for leonardoborges

leonardoborges

November 07, 2011
Tweet

Other Decks in Technology

Transcript

  1. Leonardo Borges Clouds against the floods or how RoR saved

    the day in Australia Monday, 7 November 2011
  2. self slide • ThoughtWorker in Sydney, Australia • Programming languages

    enthusiast • Blogger - leonardoborges.com • Twitter blabbermouth @leonardo_borges • Seldom OSS contributor - github.com/ leonardoborges Monday, 7 November 2011
  3. self slide • ThoughtWorker in Sydney, Australia • Programming languages

    enthusiast • Blogger - leonardoborges.com • Twitter blabbermouth @leonardo_borges • Seldom OSS contributor - github.com/ leonardoborges ...and also • Heavy Metal guitarist • Singer • Overall adrenaline junkie Monday, 7 November 2011
  4. Heroku, an overview Basic concepts • PaaS • Git based

    deployment cycle Monday, 7 November 2011
  5. Heroku, an overview Basic concepts • PaaS • Git based

    deployment cycle • Dynos (web processes) Monday, 7 November 2011
  6. Heroku, an overview Basic concepts • PaaS • Git based

    deployment cycle • Dynos (web processes) • Workers (background processes) Monday, 7 November 2011
  7. Heroku, an overview Basic concepts • PaaS • Git based

    deployment cycle • Dynos (web processes) • Workers (background processes) • Cron Monday, 7 November 2011
  8. Simplistic view of a web request request routing dyno dyno

    dyno dyno dyno dyno dyno dyno dyno dyno dyno dyno dyno dyno Monday, 7 November 2011
  9. A typical setup Environments • staging, showcase and production Environments

    • staging, showcase and production Monday, 7 November 2011
  10. A typical setup Environments • staging, showcase and production Environments

    • staging, showcase and production Branching strategy • develop • master (tagged release candidates) Monday, 7 November 2011
  11. Catches & restrictions • Read-only file system • 30 seconds

    cap on http requests Monday, 7 November 2011
  12. Catches & restrictions • Read-only file system • 30 seconds

    cap on http requests • The console hijacks the web processes Monday, 7 November 2011
  13. Catches & restrictions • Read-only file system • 30 seconds

    cap on http requests • The console hijacks the web processes • Processes limited to 300MB 512MB of RAM Monday, 7 November 2011
  14. Catches & restrictions • Read-only file system • 30 seconds

    cap on http requests • The console hijacks the web processes • Processes limited to 300MB 512MB of RAM • Busted IP based SSL solution Monday, 7 November 2011
  15. Catches & restrictions • Read-only file system • 30 seconds

    cap on http requests • The console hijacks the web processes • Processes limited to 300MB 512MB of RAM • Busted IP based SSL solution • ... and for Australia, latency Monday, 7 November 2011
  16. Troubleshooting • NewRelic: essencial to spot bottlenecks • database •

    external services - paypal, memcached • application • Heroku logs Monday, 7 November 2011
  17. Performance • ORMs are dumb • Offload stats from main

    DB • Cache everything but not until you really need it Monday, 7 November 2011
  18. The new Heroku: Celadon Cedar New features (most in public

    beta) • The procfile Monday, 7 November 2011
  19. The new Heroku: Celadon Cedar New features (most in public

    beta) • The procfile • One-off processes Monday, 7 November 2011
  20. The new Heroku: Celadon Cedar New features (most in public

    beta) • The procfile • One-off processes • Node.js/Clojure/Java/Python... Monday, 7 November 2011
  21. The new Heroku: Celadon Cedar New features (most in public

    beta) • The procfile • One-off processes • Node.js/Clojure/Java/Python... • New HTTP stack Monday, 7 November 2011
  22. The new Heroku: Celadon Cedar New features (most in public

    beta) • The procfile • One-off processes • Node.js/Clojure/Java/Python... • New HTTP stack • The foreman gem Monday, 7 November 2011
  23. The new Heroku: Celadon Cedar New features (most in public

    beta) • The procfile • One-off processes • Node.js/Clojure/Java/Python... • New HTTP stack • The foreman gem • Strive for purism Monday, 7 November 2011
  24. The new Heroku: Celadon Cedar New features (most in public

    beta) • The procfile • One-off processes • Node.js/Clojure/Java/Python... • New HTTP stack • The foreman gem • Strive for purism • In the horizon (no ETA) : multi-region availability Monday, 7 November 2011
  25. The Procfile Run anything Rails web: bundle exec rails server

    -p $PORT worker: bundle exec rake jobs:work Node.js web: node web.js Clojure web: lein run -m demo.web Monday, 7 November 2011
  26. Back in late 2010 • 75% of Queensland under water

    • 35 dead / 9 missing Monday, 7 November 2011
  27. Back in late 2010 • 75% of Queensland under water

    • 35 dead / 9 missing • A$ 30 billion in damages Monday, 7 November 2011
  28. Appeal to the people • QLD Government to run a

    telethon on Channel Nine Monday, 7 November 2011
  29. Appeal to the people • QLD Government to run a

    telethon on Channel Nine • Dry run of existing system showed problems Monday, 7 November 2011
  30. Appeal to the people • QLD Government to run a

    telethon on Channel Nine • Dry run of existing system showed problems • Backup plan? Monday, 7 November 2011
  31. We can help! • ThoughtWorks offered help • We were

    at the beach Monday, 7 November 2011
  32. We can help! • ThoughtWorks offered help • We were

    at the beach • and had 48hs to deliver! Monday, 7 November 2011
  33. We can help! • ThoughtWorks offered help • We were

    at the beach • and had 48hs to deliver! Monday, 7 November 2011
  34. What?! • Payment gateway integration • Donation receipts by email

    (thousands of them) Monday, 7 November 2011
  35. What?! • Payment gateway integration • Donation receipts by email

    (thousands of them) • Ability to scale based on load Monday, 7 November 2011
  36. What?! • Payment gateway integration • Donation receipts by email

    (thousands of them) • Ability to scale based on load user app payment gateway DB mail gateway varnish Monday, 7 November 2011
  37. Challenges • SSQ’s infra-structure was a no go • Had

    to come up with a solution for email sending as well Monday, 7 November 2011
  38. Challenges • SSQ’s infra-structure was a no go • Had

    to come up with a solution for email sending as well • Skepticism Monday, 7 November 2011
  39. Choices • AWS - Cheaper but require ops • Heroku

    - PaaS - no/less ops Monday, 7 November 2011
  40. Choices • AWS - Cheaper but require ops • Heroku

    - PaaS - no/less ops - As simple as a git push Monday, 7 November 2011
  41. Choices • AWS - Cheaper but require ops • Heroku

    - PaaS - no/less ops - As simple as a git push - Focus on your app Monday, 7 November 2011
  42. Choices • AWS - Cheaper but require ops • Heroku

    - PaaS - no/less ops - As simple as a git push - Focus on your app - Dozens of add-ons out of the box Monday, 7 November 2011
  43. Choices • AWS - Cheaper but require ops • Heroku

    - PaaS - no/less ops - As simple as a git push - Focus on your app - Dozens of add-ons out of the box - $0.00 upfront cost Monday, 7 November 2011
  44. Choices • AWS - Cheaper but require ops • Heroku

    - PaaS - no/less ops - As simple as a git push - Focus on your app - Dozens of add-ons out of the box - $0.00 upfront cost • AWS - Cheaper but require ops • Heroku - PaaS - no/less ops - As simple as a git push - Focus on your app - Dozens of add-ons out of the box - $0.00 upfront cost Monday, 7 November 2011
  45. Ben Barnard, Phillip Calçado and myself One last ingredient... An

    awesome team, committed and having fun on a weekend :) Monday, 7 November 2011
  46. The telethon • Live on channel 9 for 2 hours

    • SSQ’s app went down at the very start Monday, 7 November 2011
  47. The telethon • Live on channel 9 for 2 hours

    • SSQ’s app went down at the very start • The “backup” plan was now the main app Monday, 7 November 2011
  48. What we achieved Despite all skepticism we... • Developed a

    production ready donation app using Ruby on Rails Monday, 7 November 2011
  49. What we achieved Despite all skepticism we... • Developed a

    production ready donation app using Ruby on Rails • Leveraged PaaS to get ops out of the way Monday, 7 November 2011
  50. What we achieved Despite all skepticism we... • Developed a

    production ready donation app using Ruby on Rails • Leveraged PaaS to get ops out of the way • Generated over A$ 2 million in donations during the telethon Monday, 7 November 2011
  51. What we achieved Despite all skepticism we... • Developed a

    production ready donation app using Ruby on Rails • Leveraged PaaS to get ops out of the way • Generated over A$ 2 million in donations during the telethon • And over A$ 38 million since then Monday, 7 November 2011
  52. What we achieved Despite all skepticism we... • Developed a

    production ready donation app using Ruby on Rails • Leveraged PaaS to get ops out of the way • Generated over A$ 2 million in donations during the telethon • And over A$ 38 million since then ...all in a 48 hour effort Monday, 7 November 2011