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

Beyond Toys: Deploying a Production node.js App to the Cloud

Beyond Toys: Deploying a Production node.js App to the Cloud

Presentation at NYC's node.js meetup, July 2012
http://www.meetup.com/nodejs/events/68321162/

hunterloftis

July 18, 2012
Tweet

More Decks by hunterloftis

Other Decks in Programming

Transcript

  1. Beyond Toys I. Who the hell am I? II. The

    Five Stages of Grief III. The General Solution IV. Questions Friday, July 20, 12
  2. Hunter Loftis Director of Technology, Skookum Digital Works Charlotte, NC

    HTML5 mobile web JavaScript node.js 2 large, multi-server deployments 3 more in staging @hunterloftis [email protected] Friday, July 20, 12
  3. ...In our experience (YMMV - Windows Azure, nodester, and a

    million more aren’t covered here) Flexible Abstract Affordable Friday, July 20, 12
  4. 1. Denial You’re happily writing node apps, pretending you have

    some idea how to publish them. Friday, July 20, 12
  5. 2. Anger You try to publish, only to discover that

    nobody else understands this any better. Friday, July 20, 12
  6. 3. Bargaining If your Macguyver-ed server just stays up, you

    promise to do better next time! Friday, July 20, 12
  7. 4. Depression You realize you’re building a house of cards.

    There’s no way this is sustainable. Friday, July 20, 12
  8. 12-Factor TL;DR An app should have a single, version-controlled codebase,

    decoupled from declarative configuration and services, which is built by a developer and run by a machine as stateless, crash-only processes. Services should emerge from port binding, concurrency from processes, and logs from standard streams. Dev and prod environments should be as similar as possible, and admin tasks should be one-off processes. Friday, July 20, 12
  9. III. Config JSON outside of the git repository (a departure

    from the suggestion of ENV variables) Friday, July 20, 12
  10. IV. Backing Services No distinction between local and 3rd-party services

    - mongodb, redis, amazon aws, etc Friday, July 20, 12
  11. VII. Port Binding node handles this by default with its

    built-in http server (vs PHP/apache, Java/Tomcat) Friday, July 20, 12
  12. X. Dev/Prod Parity Knock off the knockoffs! Use the real

    deal. Mirror backing services in dev and prod. Friday, July 20, 12
  13. XII. Admin Processes Script outside of your app process. SSH

    -- #!/usr/bin/env bash -- #!/usr/bin/env node Friday, July 20, 12
  14. Thank you! Questions? • http://12factor.net • https://github.com/Skookum/cloudChat • https://github.com/skookum/base12 •

    https://github.com/skookum/nimbus • https://github.com/skookum/mason • @hunterloftis @skookum • [email protected] Friday, July 20, 12