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

Effective Node.js Architectures

Bd38b9183f8b841522dbd118ac99c024?s=47 Dan Shaw
April 01, 2013

Effective Node.js Architectures

Talk kicking off the new Geeklist San Francisco Meetup Series.
http://www.meetup.com/Geeklist-San-Francisco-Meetup-Series/events/110490112/

Note that even though it is April 1st, I exercised amazing restraint and did not have one April Fools joke.

Ustream recording: http://www.ustream.tv/recorded/30764037

Bd38b9183f8b841522dbd118ac99c024?s=128

Dan Shaw

April 01, 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
  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. • 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, etc • 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