devops
DESCRIPTION
PrTRANSCRIPT
DevOps <3 node.js
github.com/miccolis | twitter.com/miccolis
SaaS DevOps @mapbox
Not the kind of job where I expected to use javascript.
“Ah, right server side javascript”
What is node.js again?
“Yea, cool so your front end devs can help, and you can use the same libraries, and
probably even run all the same code on the server or the client, right? That’s great!”
Everyone’s first response to node.js
No.
Everyone’s first response to node.jsis wrong.
<html><body><script>alert("Hello World");</script></body></html>
<html><head><script src="jquery-1.2.6.min.js"></script></head><body><script>$(document).ready(function(){ $("#mydiv").html("Hello World");});</script><div id="mydiv"></div></body></html>
Most of that was DOM
$(document).ready()
...will be disregarded as just boilerplate.
It’s true, you can use the same libraries.
They all expect async I/O
And build a framework where the application can
run on the client or server!
https://github.com/developmentseed/bones
YMMV
It’s not what most people expect, but there are good
parts.
Async I/O
Done the most simple way that could possibly work.
First class server support
The node.js ‘hello world’ is a HTTP server,in 6 lines.
A package manager
The best I’ve ever worked with.
The kinds of things that make my life easier.
Node.js & C10K
1. Event loop & non-blocking I/O
2. Simple & direct API; `callback(err, ...)`
3. ?
4. Profit
Node.js & HTTP
• Any node.js program is a HTTP server (or could become one with trivial effort).
• Your program is defined by its HTTP API, and can be tested as such.
• Stateless, tested == rapidly deployable.
Node.js & NPM
• Requires semantic versioning.
• Completely captures dependencies.
• Handles multiple instances of the same package with different versions.
• Wildly inclusive.
In practice
Building servers
• Lots of small projects
• Scale independently
• Varying lifecycles
Packaging
• Every commit hits CI testing
• Every commit is built into a deployable “slug”
• Anything merged into `master` is considered production ready.
Streamlined deployment
• Main client-side application is automatically deployed on every update to `master`.
• Other applications can be deployed by any developer using a single CLI command.*
* database cluster’s still require babysitting.
Because I need HTTP servers that scale...
Why node.js?
...and a strong open source community helping with
libraries.
Why node.js?
Thanks
Questions?