Skip to content

Instantly share code, notes, and snippets.

@bradoyler
Last active February 5, 2020 05:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradoyler/e55a3e1f2dc53650d5439a175e30cc98 to your computer and use it in GitHub Desktop.
Save bradoyler/e55a3e1f2dc53650d5439a175e30cc98 to your computer and use it in GitHub Desktop.
Nodejs (6.x) standards

Node Standards (v6.x)

The 7 Commandments of Node:

  1. processes shall be small, and start instantly
  2. always communicate via message bus (Redis, RabbitMQ)
    • this is intended to avoid blocking IO like a slow HTTP request
  3. each process shall log to stdout
    • it's not the responsibility of the app to route logs
  4. a process shall not maintain state
    • avoid in-memory session ids, socket connections, etc
  5. unrecoverable errors shall exit process immediately
    • this is acceptable because of #1
  6. configuration controls behavior
    • reduce frivolous code changes
  7. deployment artifacts are archived into a binary copy
    • intended for easy rollback

Some Nodejs choices we can agree on:

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment