FOR
EVERYTHING
A SHORT STORY BY CHARLIE KEY
charlie@modulus.io - @zwigby
0.6.8
LET YOUR PROCESS
CRASH
$	
  npm	
  install	
  pm2@latest	
  -­‐g
pm2	
  
Modern CLI process manager for Node apps with a
b...
FIND ISSUES
node-­‐inspector	
  
Web Inspector based nodeJS debugger
$	
  npm	
  install	
  node-­‐inspector	
  -­‐g
$	
  ...
CONGRESS
(API)
APERTURE
(WEBSITE)
FULCRUM
(CLI)
MEDUSA
(DEPLOYMENT MANAGER)
APP HOST
LOAD BALANCER
CUSTOMER APP
INCOMING T...
npm versioning
"dependencies":	
  {	
  
	
  	
  "express":	
  "*"	
  
}
No	
  Asterisks	
  
Please for the love don’t use ...
LESSONS LEARNED
stateless	
  
Keep your application as stateless as possible
redis	
  
Great tool if you need to keep state
API
The natural born use case for Node.js
express	
  
Fast, unopinionated, minimalist web framework
hapi	
  
HTTP Server f...
FINAL THOUGHTS
horizontal	
  scalability	
  
Be stateless or have a thought out solution
don’t	
  reinvent	
  the	
  wheel...
SLIDE OF MANY
THINGS
pm2	
  www.npmjs.org/package/pm2	
  
forever	
  www.npmjs.org/package/forever	
  	
  
node-­‐inspecto...
@zwigby
Node.js Everywhere by @zwigby
Node.js Everywhere by @zwigby
Node.js Everywhere by @zwigby
Node.js Everywhere by @zwigby
Node.js Everywhere by @zwigby
Node.js Everywhere by @zwigby
Node.js Everywhere by @zwigby
Upcoming SlideShare
Loading in …5
×

Node.js Everywhere by @zwigby

5,354 views

Published on

A look at a few lessons from building our company, Modulus (http://modulus.io), completely on JavaScript and Node.js. Lessons include how to restart your application on crash and what API frameworks there are, and more...

Published in: Technology

Node.js Everywhere by @zwigby

  1. 1. FOR EVERYTHING A SHORT STORY BY CHARLIE KEY charlie@modulus.io - @zwigby
  2. 2. 0.6.8
  3. 3. LET YOUR PROCESS CRASH $  npm  install  pm2@latest  -­‐g pm2   Modern CLI process manager for Node apps with a builtin load-balancer $  pm2  start  app.js $  npm  install  forever  -­‐g forever   A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever) $  forever  start  app.js
  4. 4. FIND ISSUES node-­‐inspector   Web Inspector based nodeJS debugger $  npm  install  node-­‐inspector  -­‐g $  node-­‐debug  app.js
  5. 5. CONGRESS (API) APERTURE (WEBSITE) FULCRUM (CLI) MEDUSA (DEPLOYMENT MANAGER) APP HOST LOAD BALANCER CUSTOMER APP INCOMING TRAFFIC METRICS COLLECTION
  6. 6. npm versioning "dependencies":  {      "express":  "*"   } No  Asterisks   Please for the love don’t use asterisks. Use proper versioning. "dependencies":  {      "express":  "4.0"   }
  7. 7. LESSONS LEARNED stateless   Keep your application as stateless as possible redis   Great tool if you need to keep state
  8. 8. API The natural born use case for Node.js express   Fast, unopinionated, minimalist web framework hapi   HTTP Server framework - from the minds at Walmart restify   REST framework
  9. 9. FINAL THOUGHTS horizontal  scalability   Be stateless or have a thought out solution don’t  reinvent  the  wheel   unless you want to, npm is there for a reason start  testing  early   Pick a testing framework and start writing tests streams   Learn to use them - streams adventure kiss   Keep it simple stupid
  10. 10. SLIDE OF MANY THINGS pm2  www.npmjs.org/package/pm2   forever  www.npmjs.org/package/forever     node-­‐inspector  www.npmjs.org/package/node-­‐inspector   npm  semver  www.npmjs.org/doc/misc/semver.html   redis  redis.io   expressjs  expressjs.com   hapi  hapijs.com   restify  mcavage.me/node-­‐restify   jasmine  jasmine.github.io   stream-­‐adventure  www.npmjs.org/package/stream-­‐adventure   !
  11. 11. @zwigby

×