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

Secrets of a Node Team

Paul Serby
October 08, 2013

Secrets of a Node Team

The highs and lows a node.js agency

Paul Serby

October 08, 2013
Tweet

More Decks by Paul Serby

Other Decks in Technology

Transcript

  1. WHY NODE ‣ 10 years doing PHP ‣ Waited 3

    years for PHP 6 ‣ Frameworks V2.0 starting to appear
  2. WHY NODE ‣ 10 years doing PHP ‣ Waited 3

    years for PHP 6 ‣ Frameworks V2.0 starting to appear ‣ Blocking IO was consistently our main bottleneck at scale
  3. WHY NODE ‣ 10 years doing PHP ‣ Waited 3

    years for PHP 6 ‣ Frameworks V2.0 starting to appear ‣ Blocking IO was consistently our main bottleneck at scale ‣ Bored of PHP
  4. Semantic Versioning 2.0.0 MAJOR . MINOR . PATCH MAJOR version

    when you make incompatible API changes
  5. Semantic Versioning 2.0.0 MAJOR . MINOR . PATCH MAJOR version

    when you make incompatible API changes MINOR version when you add backwards-compatible functionality
  6. Semantic Versioning 2.0.0 MAJOR . MINOR . PATCH MAJOR version

    when you make incompatible API changes MINOR version when you add backwards-compatible functionality PATCH version when you make backwards-compatible bug fixes
  7. Semantic Versioning 2.0.0 MAJOR . MINOR . PATCH MAJOR version

    when you make incompatible API changes MINOR version when you add backwards-compatible functionality PATCH version when you make backwards-compatible bug fixes http://semver.org
  8. Most modules should have exactly 1 export. Module systems should

    be designed around that use case first, not for dozens of exports. substack if your module exposes more than one function, you might be doing it wrong :) mikeal
  9. SEPARATION ‣ Craft your application by combining modules ‣ Build

    as many applications as you need ‣ Your web server is a web server it’s not a: CSS compiler, JavaScript compiler, Message queue, Email dispatcher, Certainly not cron!
  10. SEPARATION ‣ Craft your application by combining modules ‣ Build

    as many applications as you need ‣ Your web server is a web server it’s not a: CSS compiler, JavaScript compiler, Message queue, Email dispatcher, Certainly not cron! ‣ Ensure your applications and processes can talk to each other
  11. LOAD BALANCER CDN WEB SITE REST API TEMPORAL AGENTS (CRON)

    CMS ADMIN REST API WORKERS NPM APPS DOMAIN SERVICES 3rd PARTY MODULES PROJECT MODULES
  12. LOAD BALANCER CDN WEB SITE REST API TEMPORAL AGENTS (CRON)

    CMS ADMIN REST API WORKERS APPS MESSAGE BUS (0MQ)
  13. PAIN ‣ NPM isn’t always available ‣ NPM can be

    slow ‣ No SLA ‣ Deployments depend on NPM
  14. PAIN ‣ NPM isn’t always available ‣ NPM can be

    slow ‣ No SLA ‣ Deployments depend on NPM ‣ Some of our code needs to be private
  15. PAIN ‣ NPM isn’t always available ‣ NPM can be

    slow ‣ No SLA ‣ Deployments depend on NPM ‣ Some of our code needs to be private ‣ ‘npm update’ doesn’t work with git URLs
  16. JOY

  17. SOLUTION ‣ Learn the tools ‣ dtrace / Manta ‣

    heap-dump - https://github.com/bnoordhuis/node-heapdump
  18. SOLUTION ‣ Learn the tools ‣ dtrace / Manta ‣

    heap-dump - https://github.com/bnoordhuis/node-heapdump ‣ Assume there are always memory leaks
  19. SOLUTION ‣ Learn the tools ‣ dtrace / Manta ‣

    heap-dump - https://github.com/bnoordhuis/node-heapdump ‣ Assume there are always memory leaks ‣ Monitor memory
  20. SOLUTION ‣ Learn the tools ‣ dtrace / Manta ‣

    heap-dump - https://github.com/bnoordhuis/node-heapdump ‣ Assume there are always memory leaks ‣ Monitor memory ‣ Make sure your application restarts quickly
  21. SOLUTION ‣ Learn the tools ‣ dtrace / Manta ‣

    heap-dump - https://github.com/bnoordhuis/node-heapdump ‣ Assume there are always memory leaks ‣ Monitor memory ‣ Make sure your application restarts quickly ‣ Restart your application nightly