Millions of Apps Deployed

Millions of Apps Deployed

Heroku has deployed over a million applications in most web languages and frameworks, see what we've learned in the process!

Db953d125f5cc49756edb6149f1b813e?s=128

Richard Schneeman

November 12, 2012
Tweet

Transcript

  1. 2.
  2. 5.
  3. 6.
  4. 11.
  5. 14.
  6. 18.

    Twelve Factor • Can apply to any language • Speeds

    up deployment, makes scaling easier & keeps apps clean • Developed over direct exposure to the deployment of hundreds of thousands of apps
  7. 19.

    12factor.net • Codebase • One codebase tracked in revision control,

    many deploys • Dependencies • Explicitly declare and isolate dependencies • Config • Store config in the environment • Backing Services • Treat backing services as attached resources
  8. 20.

    12factor.net • Build, Release, Run • Strictly separate build and

    run stages • Process • Execute the app as one or more stateless processes • Port Binding • Export services via port binding • Concurrency • Scale out via the process model
  9. 21.

    12factor.net • Disposability • Maximize robustness with fast startup and

    graceful shutdown • Dev/Prod Parity • Keep development, staging, and production as similar as possible • Logs • Treat logs as event streams • Admin Process • Run admin/management tasks as one-off processes
  10. 28.
  11. 30.
  12. 53.

    VPS • Use Foreman/Dotenv • Add to bashrc • Add

    values directly to command $ SECRET_TOKEN=asd123 rails console ruby-1.9.3> puts ENV[‘SECRET_TOKEN’] ruby-1.9.3> “asd123”
  13. 61.

    Config • What varies between deploys • resource strings to

    databases • credentials to S3, twitter, facebook, etc. • canonical values, hostname • security tokens
  14. 66.
  15. 76.
  16. 79.
  17. 86.

    Development • As close to production as possible • Same

    data-stores (postgres, memcache) • Same language versions (Ruby 1.9) • Real/consistent data
  18. 89.

    README.md • Living document • Standardize dev environment • Instructions

    for external dependencies • Instructions for starting processes • Problem with dev environment? • Put the fix in the readme $ brew install memcache $ foreman start
  19. 94.
  20. 102.
  21. 103.
  22. 104.
  23. 105.
  24. 106.
  25. 107.
  26. 109.
  27. 112.
  28. 116.
  29. 117.
  30. 119.

    Error Notification • Record Logs & Errors • New Relic

    (rpm) • Airbrake (hoptoad) • HoneyBadger
  31. 120.
  32. 122.

    Error Pages • Admins get error + Backtrace Couldn't find

    Course with ID=chunkybacon Details Params: {"action"=>"show", "controller"=>"courses", "id"=>"chunkybacon"} Backtrace: lib/active_record/relation/finder_methods.rb:304:in `find_one'
  33. 123.

    Admin Error Pages + Backtrace Couldn't find Course with ID=chunkybacon

    Details Params: {"action"=>"show", "controller"=>"courses", "id"=>"chunkybacon"} Backtrace: lib/active_record/relation/finder_methods.rb:304:in `find_one'