Disassembling the Monolith: Taming Large Software Projects with Node.js

51
Disassembling the Monolith taming large software projects with @nicholaswyoung Nodevember, 2014 bit.ly/nodevember-2014

Transcript of Disassembling the Monolith: Taming Large Software Projects with Node.js

Page 1: Disassembling the Monolith: Taming Large Software Projects with Node.js

Disassembling the Monolithtaming large software projects with

@nicholaswyoung Nodevember, 2014 bit.ly/nodevember-2014

Page 2: Disassembling the Monolith: Taming Large Software Projects with Node.js

Who is this guy?

Page 3: Disassembling the Monolith: Taming Large Software Projects with Node.js

@nicholaswyoung

radio host designer

photographer ex-software developer

extraordinarily busy person

Page 4: Disassembling the Monolith: Taming Large Software Projects with Node.js

originalmachine.com

Page 5: Disassembling the Monolith: Taming Large Software Projects with Node.js

radio programs

I make compelling, educational

(think of us as a slightly edgier

NPR)

photo credit: derrick clifton / medill photojournalism

Page 6: Disassembling the Monolith: Taming Large Software Projects with Node.js

machine.fm

Page 7: Disassembling the Monolith: Taming Large Software Projects with Node.js

DONEI love getting things

Page 8: Disassembling the Monolith: Taming Large Software Projects with Node.js

uselesstinkering is

unless it teaches us something

Page 9: Disassembling the Monolith: Taming Large Software Projects with Node.js

writing codemy passion isn’t

(I lost that years ago.)

Page 10: Disassembling the Monolith: Taming Large Software Projects with Node.js

writing code for the sake of writing code

my passion isn’t

Page 11: Disassembling the Monolith: Taming Large Software Projects with Node.js

javascriptI promise to show you some clever

before we’re done here

Page 12: Disassembling the Monolith: Taming Large Software Projects with Node.js

“scalability”

Page 13: Disassembling the Monolith: Taming Large Software Projects with Node.js

“scalability”“Scalability is the ability of a system, network, or process to handle a growing amount of work in a capable manner or its ability to be enlarged to accommodate that growth.” - Wikipedia

Page 14: Disassembling the Monolith: Taming Large Software Projects with Node.js

“scalability”

pain

in th

e as

s fa

ctor

time

Page 15: Disassembling the Monolith: Taming Large Software Projects with Node.js

the year of explosions

Page 16: Disassembling the Monolith: Taming Large Software Projects with Node.js
Page 17: Disassembling the Monolith: Taming Large Software Projects with Node.js
Page 18: Disassembling the Monolith: Taming Large Software Projects with Node.js
Page 19: Disassembling the Monolith: Taming Large Software Projects with Node.js

Rubya programmer’s best friend

Page 20: Disassembling the Monolith: Taming Large Software Projects with Node.js

slow runtime poor threading support

concurrent long running tasks

Page 21: Disassembling the Monolith: Taming Large Software Projects with Node.js

slow runtime poor threading support

concurrent long running tasks

Page 22: Disassembling the Monolith: Taming Large Software Projects with Node.js

not knockin’ itruby is still awesome, in a lot

of ways

Page 23: Disassembling the Monolith: Taming Large Software Projects with Node.js

but a lot of it needs to be rethought

Page 24: Disassembling the Monolith: Taming Large Software Projects with Node.js

file upload

server processing

store processed files in the cloud

Page 25: Disassembling the Monolith: Taming Large Software Projects with Node.js

file upload

server processing

store processed files in the cloud

everyone does this

your thread is waiting

Page 26: Disassembling the Monolith: Taming Large Software Projects with Node.js

while everything happens, your user

thinks the app is doing nothing

Page 27: Disassembling the Monolith: Taming Large Software Projects with Node.js

with several users submitting large file

uploads, our app grinds to a halt

* only on one thread, sure, but that’s still bad.

Page 28: Disassembling the Monolith: Taming Large Software Projects with Node.js

why?because I built a monolith:

public facing website feed generation

embeddable, sharable player admin dashboard

media analytics

were all a single app

Page 29: Disassembling the Monolith: Taming Large Software Projects with Node.js

failed deploy = all services

down

Page 30: Disassembling the Monolith: Taming Large Software Projects with Node.js
Page 31: Disassembling the Monolith: Taming Large Software Projects with Node.js

this sucks.it doesn’t mean ruby is inherently

awful, but it didn’t work for our app.

Page 32: Disassembling the Monolith: Taming Large Software Projects with Node.js
Page 33: Disassembling the Monolith: Taming Large Software Projects with Node.js

“I believe Node is capable of delivering the same, if not better, results than Rails for any Web development task, although it's slightly less mature … and the conventions are less stable.…”

- Sagi Isha, freelance web developer

Page 34: Disassembling the Monolith: Taming Large Software Projects with Node.js
Page 35: Disassembling the Monolith: Taming Large Software Projects with Node.js

var express = require('express') , api = express() , web = express() , server = express();

server.use('/', web); server.use('/api', api);

server.listen(8000);

Page 36: Disassembling the Monolith: Taming Large Software Projects with Node.js

var express = require('express') , api = express() , web = express() , server = express();

server.use('/', web); server.use('/api', api);

server.listen(8000);

Page 37: Disassembling the Monolith: Taming Large Software Projects with Node.js
Page 38: Disassembling the Monolith: Taming Large Software Projects with Node.js
Page 39: Disassembling the Monolith: Taming Large Software Projects with Node.js

encourages you to build small, interconnected applications that each tackle a specific domain.

Page 40: Disassembling the Monolith: Taming Large Software Projects with Node.js

CMS Feed Generation Embeddable Player Media Analytics

Models Config

Applications Dependencies

Page 41: Disassembling the Monolith: Taming Large Software Projects with Node.js

javascriptlet’s talk

Page 42: Disassembling the Monolith: Taming Large Software Projects with Node.js

• express • mongodb • zeromq

common application stack

Page 43: Disassembling the Monolith: Taming Large Software Projects with Node.js

• distributor • storage • transport

common application stack

Page 44: Disassembling the Monolith: Taming Large Software Projects with Node.js

DEMO

Page 45: Disassembling the Monolith: Taming Large Software Projects with Node.js

relentlesslyprototype

Page 46: Disassembling the Monolith: Taming Large Software Projects with Node.js

breakBEFOREyou build

Page 47: Disassembling the Monolith: Taming Large Software Projects with Node.js

what do I need?ask

Page 48: Disassembling the Monolith: Taming Large Software Projects with Node.js

operatecan each function of your app

discreetly?

Page 49: Disassembling the Monolith: Taming Large Software Projects with Node.js
Page 50: Disassembling the Monolith: Taming Large Software Projects with Node.js

Q&Aask me anything

Page 51: Disassembling the Monolith: Taming Large Software Projects with Node.js

nicholaswyoung.com OriginalMachine.com

Mixdown.co Machine.FM

@nicholaswyoung