devops

28
DevOps <3 node.js github.com/miccolis | twitter.com/miccolis

Upload: jeff-miccolis

Post on 06-May-2015

161 views

Category:

Technology


0 download

DESCRIPTION

Pr

TRANSCRIPT

Page 1: DevOps

DevOps <3 node.js

github.com/miccolis | twitter.com/miccolis

Page 2: DevOps

SaaS DevOps @mapbox

Not the kind of job where I expected to use javascript.

Page 3: DevOps

“Ah, right server side javascript”

What is node.js again?

Page 4: DevOps

“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

Page 5: DevOps

No.

Everyone’s first response to node.jsis wrong.

Page 6: DevOps

<html><body><script>alert("Hello World");</script></body></html>

Page 7: DevOps

<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>

Page 8: DevOps

Most of that was DOM

Page 9: DevOps

$(document).ready()

...will be disregarded as just boilerplate.

Page 10: DevOps

It’s true, you can use the same libraries.

They all expect async I/O

Page 11: DevOps

And build a framework where the application can

run on the client or server!

https://github.com/developmentseed/bones

Page 12: DevOps

YMMV

Page 13: DevOps

It’s not what most people expect, but there are good

parts.

Page 14: DevOps

Async I/O

Done the most simple way that could possibly work.

Page 15: DevOps

First class server support

The node.js ‘hello world’ is a HTTP server,in 6 lines.

Page 16: DevOps

A package manager

The best I’ve ever worked with.

Page 17: DevOps

The kinds of things that make my life easier.

Page 18: DevOps

Node.js & C10K

1. Event loop & non-blocking I/O

2. Simple & direct API; `callback(err, ...)`

3. ?

4. Profit

Page 19: DevOps

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.

Page 20: DevOps

Node.js & NPM

• Requires semantic versioning.

• Completely captures dependencies.

• Handles multiple instances of the same package with different versions.

• Wildly inclusive.

Page 21: DevOps

In practice

Page 22: DevOps

Building servers

• Lots of small projects

• Scale independently

• Varying lifecycles

Page 23: DevOps

Packaging

• Every commit hits CI testing

• Every commit is built into a deployable “slug”

• Anything merged into `master` is considered production ready.

Page 24: DevOps

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.

Page 25: DevOps
Page 26: DevOps

Because I need HTTP servers that scale...

Why node.js?

Page 27: DevOps

...and a strong open source community helping with

libraries.

Why node.js?

Page 28: DevOps

Thanks

Questions?