22
node.ninjas welcome to now on the 1st Thursday of every month

Sydney Node Ninjas, July 2015

Embed Size (px)

Citation preview

Page 1: Sydney Node Ninjas, July 2015

node.ninjaswelcome to

now on the 1st Thursday

of every month

Page 2: Sydney Node Ninjas, July 2015

Romain

James

Page 3: Sydney Node Ninjas, July 2015

kitchen and bathrooms behind you, on the left

please save questions for the end

just be nice (/◔ ◡ ◔)/

house.rules

Page 4: Sydney Node Ninjas, July 2015

6:45 Modular development Mehdi Valikhani

7:15 Break

7:30 Five weird tricks to make Node fast Tim Downs & Zekai Zheng

8:00 Break

8:05 Building isomorphic applications Danial Khosravi

8:40 Finish (need help? hiring?)

tonight’s.agenda

Page 5: Sydney Node Ninjas, July 2015

node.at.tabcorp

Page 6: Sydney Node Ninjas, July 2015
Page 7: Sydney Node Ninjas, July 2015

Cyclic around big events

Up to 150,000 concurrent users across web & mobile

Single API for all website, mobile, 3rd party… peaking at

- 500 information calls / sec

- 100 transactions / sec

- over 1 million API calls on Melbourne Cup day

tab.in.numbers

Page 8: Sydney Node Ninjas, July 2015
Page 9: Sydney Node Ninjas, July 2015

UX

Front-end (CSS)

Front-end (JS)

HTTP

Backend

Databases

Infrastructure

Page 10: Sydney Node Ninjas, July 2015
Page 11: Sydney Node Ninjas, July 2015
Page 12: Sydney Node Ninjas, July 2015

https://unpm.nodesource.com

rich.ecosystem

Page 13: Sydney Node Ninjas, July 2015

things.we.learnt

Page 14: Sydney Node Ninjas, July 2015

<XML>

<XML>

<XML>

<XML>

DB

DB

DB

DB

single process4 feeds

cpu.bottlenecks

Page 15: Sydney Node Ninjas, July 2015

<XML> DB

<XML> DB

<XML> DB

<XML> DB

4 processes

Page 16: Sydney Node Ninjas, July 2015

the.internet

Page 17: Sydney Node Ninjas, July 2015

careful of “maxSockets” (default is 5)

outbound http requests

node origin  server

nginx  or  varnish

localhost TCP keep-alive

Node not great at re-using HTTP connections

Page 18: Sydney Node Ninjas, July 2015

is your information cacheable?

- we could put it in Redis… but why not a reverse proxy?

do you need to scale up?

browser nodenginx  or  varnish

cache Max-age: 10

- we serve 90% of our cacheable traffic from proxies

Page 19: Sydney Node Ninjas, July 2015

plug-and-play middleware

ServeStatic

CORS

GZIP

Page 20: Sydney Node Ninjas, July 2015

browser

Origin: web1.com

Access-Control-Allow-Origin: web1.com

reverse  proxy

node  +  

CORS

browser

Origin: web2.comAccess-Control-Allow-Origin: web2.com

Page 21: Sydney Node Ninjas, July 2015

reverse  proxy  +  

CORS

browser

Access-Control-Allow-Origin: web1.com

node

browser

Access-Control-Allow-Origin: web2.com

half the traffic!

Page 22: Sydney Node Ninjas, July 2015

in.summary

Node is brilliant

it’s working so well for us both at team-scale, and system-scale

but it’s not meant to solve everything