sydney node ninjas, july 2015

Post on 07-Aug-2015

72 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

node.ninjaswelcome to

now on the 1st Thursday

of every month

Romain

James

kitchen and bathrooms behind you, on the left

please save questions for the end

just be nice (/◔ ◡ ◔)/

house.rules

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

node.at.tabcorp

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

UX

Front-end (CSS)

Front-end (JS)

HTTP

Backend

Databases

Infrastructure

https://unpm.nodesource.com

rich.ecosystem

things.we.learnt

<XML>

<XML>

<XML>

<XML>

DB

DB

DB

DB

single process4 feeds

cpu.bottlenecks

<XML> DB

<XML> DB

<XML> DB

<XML> DB

4 processes

the.internet

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

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

plug-and-play middleware

ServeStatic

CORS

GZIP

browser

Origin: web1.com

Access-Control-Allow-Origin: web1.com

reverse  proxy

node  +  

CORS

browser

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

reverse  proxy  +  

CORS

browser

Access-Control-Allow-Origin: web1.com

node

browser

Access-Control-Allow-Origin: web2.com

half the traffic!

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

top related