Pro Yearly is on sale from $80 to $50! »

Effective Node.js Architectures

Effective Node.js Architectures

Talk given at DenverJS meetup in their amazing art space.
http://www.meetup.com/Denver-JS/events/117875302/

Video: http://youtu.be/wVEp2LjE9PY

Bd38b9183f8b841522dbd118ac99c024?s=128

Dan Shaw

June 13, 2013
Tweet

Transcript

  1. Effective Node.js Architectures @dshaw

  2. Daniel D. Shaw @dshaw

  3. I like to build things with Node

  4. Build Node Things • Storify • Spreecast • Node Knockout

    • Voxer • The Node Firm
  5. Do Less Well

  6. FP for Distributed Architectures

  7. What do I do? - your processes

  8. Evolutionary Shapes • ALL THE THINGS! • Generalization • Specialization

    • One Thing
  9. ALL THE THINGS Mixture

  10. ALL THE THINGS Easy to run, multi-process, single execution point.

  11. Generalization Not all apps need to aspire to be the

    next Facebook.
  12. Scale Will you really need it?

  13. Building and Planning Node.js application

  14. Generalization • Express + Socket.io + API • Website +

    API • Restify • Hapi.js
  15. Am I doing too much?

  16. Trade-offs

  17. Trade-offs • Expensive loads limit conjoined services. • Impact of

    exceptions and crashes. • Deployment complexity. • Deployment isolation. • Ability to evolve services independently.
  18. Dumb Clusters Simple Pooling

  19. Dumb Cluster • Static file server • Simple web sites

    • Minimal client/server • API server hosts
  20. Pooling Tools • Round Robin DNS • Varnish • Nginx

    • HAProxy • ...more node
  21. Pooling Tools • Substack - seaport + bouncy • Nodejitsu

    - node-http-proxy • Poolee - battle tested at Voxer
  22. Distribute Load Data store(s) have the definitive answers

  23. Smarter Clusters Session Affinity

  24. Sticky Sessions

  25. Sticky Sessions Resources • 3rd party infrastructure • HAProxy •

    nginx • stud-proxy - Mikeal
  26. Smart Clusters (Consistent Hash Rings)

  27. Why? Complex interactions or data persistence

  28. Properties of Consistent Hash Rings • Deterministic • Change has

    minimal impact on determinism • Crunchy middle?
  29. House of Pain Complexity

  30. Consistent Hash Ring Resources • node-hashring - 3rdEden • node-hash-ring

    - Brian Noguchi, C++, dated • Build your own
  31. Right for the Task As simple as possible

  32. None
  33. Thank You! <3 dshaw