Slide 1

Slide 1 text

Integrating Node.js into an existing technology stack

Slide 2

Slide 2 text

Andrew Nesbitt github.com/andrew @teabass

Slide 3

Slide 3 text

forwardtechnology.co.uk

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Show of hands

Slide 8

Slide 8 text

Benefits of Node

Slide 9

Slide 9 text

Legacy Systems

Slide 10

Slide 10 text

Benefits of integration

Slide 11

Slide 11 text

Let’s do this!

Slide 12

Slide 12 text

1. Standalone Tools

Slide 13

Slide 13 text

Command line tools Asset minification Pixel Trackers Url shorteners Internal tools Monitoring Chat bots Examples

Slide 14

Slide 14 text

Legacy App Internal tool Internal tool Internal tool Internal tool

Slide 15

Slide 15 text

Easy to setup Very little integration Little experience needed Pros

Slide 16

Slide 16 text

Extra dependencies Knowledge silos Cons

Slide 17

Slide 17 text

2. Shared databases

Slide 18

Slide 18 text

Connect directly existing database Read from a data warehouse Share data with a key-value store Examples

Slide 19

Slide 19 text

Legacy App DB Node

Slide 20

Slide 20 text

Quick and dirty Adapters for almost every DB available Slow databases not a problem Pros

Slide 21

Slide 21 text

Duplicating domain logic Race-conditions Your DBA will likely hate you Cons

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

3. Using APIs

Slide 24

Slide 24 text

Use API from existing application Linkedin Mobile Github Downloads Examples

Slide 25

Slide 25 text

Legacy App DB Node

Slide 26

Slide 26 text

Avoid duplication of domain logic JSON APIs are lovely to work with Plays to Nodes strengths Pros

Slide 27

Slide 27 text

Extra load on existing application Might have to build/extend existing API What if the legacy app goes down? Cons

Slide 28

Slide 28 text

4. Creating APIs

Slide 29

Slide 29 text

Websocket Services Streaming services APIs for Mobile Apps Proxy serivces File upload handling Ebay’s ql.io Examples

Slide 30

Slide 30 text

DB Node Clients

Slide 31

Slide 31 text

Handle very load Lots of concurrent connections JSON comes naturally Pros

Slide 32

Slide 32 text

Cons You now have a dependeny on Node System adminstration Teaching others about it

Slide 33

Slide 33 text

mysql Rails Disc Cache Nginx Redis Node Browser Pusher http://live.mpora.com Mpora Live

Slide 34

Slide 34 text

5. Message Queues

Slide 35

Slide 35 text

ZeroMQ Resque Redis Pubsub dnode Examples

Slide 36

Slide 36 text

Message Queue Legacy App Node Legacy Worker

Slide 37

Slide 37 text

6. Streams

Slide 38

Slide 38 text

Twitter, Facebook, Salesforce HTTP long polling Comet XMPP Examples

Slide 39

Slide 39 text

7. Embedding

Slide 40

Slide 40 text

Ruby Racer Android Hadoop and Timothy Sprintstack PLV8 Examples

Slide 41

Slide 41 text

create or replace function fib(n int) returns int as $$ function fib(n) { return n<2 ? n : fib(n-1) + fib(n-2) } return fib(n) $$ LANGUAGE plv8 IMMUTABLE STRICT;

Slide 42

Slide 42 text

http://pgeu-plv8.herokuapp.com

Slide 43

Slide 43 text

Legacy App Node

Slide 44

Slide 44 text

Scripting within compiled languages Use existing, battle tested software Enable Node on embedded devices Pros

Slide 45

Slide 45 text

Under heavy development You need to know the host platform Context switching overhead Cons

Slide 46

Slide 46 text

Take a unix-like approach Decoupled Systems Use APIs to share data Play to node’s strengths Summary

Slide 47

Slide 47 text

Node on Andriod - lanyrd.com/smpbg Rails and Node.js - lanyrd.com/srmwr Hadoop and Timothy - lanyrd.com/sttxx Rhinode (Sprintstack) - lanyrd.com/srmwx These slides - lanyrd.com/szwyc Links