Skip to content

Instantly share code, notes, and snippets.

@sranso
Last active August 29, 2015 14:10
Show Gist options
  • Save sranso/1e1d882b09420fac8eb0 to your computer and use it in GitHub Desktop.
Save sranso/1e1d882b09420fac8eb0 to your computer and use it in GitHub Desktop.

##production-ready node architecture

signs of a successful Node app:

it's made of several small processes that start instantly, maintain no state, and communicate via a language-agnostic message bus. each process logs to stdout and responds to unrecoverable errors by exiting immediately. a load-balancer queues requests, which are served in fixed time by scaling service levels. configuration controls behavior without any need to deploy new code. each deploy is archived into a perfect binary copy.

  • sm pr -- sm mem footprint, light, not lots of blocking cpu ops
  • st inst -- gives level of fault tolerance
  • no st -- if process dies, state dies with it
  • ex im -- just exit and start over when you have a prob
  • l-b -- use something like ngnix or proxy
  • co co be -- conf options should be part of env
  • pe bi co -- archive your deploys!
  • the apps also drop down to lang-indy text or JSON interfaces for doing and recording work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment