Urturn on AWS: scaling infra, cost and time to maket

21
Urturn on AWS scaling infrastructure, cost and 6me to market

description

 

Transcript of Urturn on AWS: scaling infra, cost and time to maket

Page 1: Urturn on AWS: scaling infra, cost and time to maket

Urturn  on  AWS  -­‐  scaling  infrastructure,    cost  and  6me  to  market  

Page 2: Urturn on AWS: scaling infra, cost and time to maket
Page 3: Urturn on AWS: scaling infra, cost and time to maket

confiden6al   3  

Page 4: Urturn on AWS: scaling infra, cost and time to maket

Limited  ways  to  express  

confiden6al   4  

 Write  something…  

 Write  something…  

Page 5: Urturn on AWS: scaling infra, cost and time to maket

Expressions  ready-­‐made  templates  

confiden6al   5  

Page 6: Urturn on AWS: scaling infra, cost and time to maket

Music  go-­‐to-­‐market  

Urturn  turns  out  to  be  a  great  response  to  audience  engagement,  one  of  the  main  challenge  

of  music  industry  

-­‐>  Hired  talent  from  that  industry  

-­‐>  Got  bands  on  urturn  

-­‐>  Brought  their  fan  base,  centered  on  UK  &  US  

confiden6al   6  

Page 7: Urturn on AWS: scaling infra, cost and time to maket

confiden6al   7  

#DrawUnionJ  

Page 8: Urturn on AWS: scaling infra, cost and time to maket

confiden6al   8  

#ImatchwithUnionJ  

Page 9: Urturn on AWS: scaling infra, cost and time to maket

confiden6al   9  

Page 10: Urturn on AWS: scaling infra, cost and time to maket

Traffic  Peaks  

Max

Time to half: 5 min for Twitter, one hour for FB

Share on FB or Twitter

Time to max: 10 sec on Twitter, 1 min on FB

Page 11: Urturn on AWS: scaling infra, cost and time to maket

Urturn Web Back - AWS Urturn Front

Js client

Urturn reactive Serving web pages

Rails

Storage AWS S3

Master Database MySQL

Global  architecture  

iPhone app

Expressions Apps

Urturn tasks Computing

activities, emails

Rails

Load

bal

ance

rs

Am

azon

Web

Ser

vice

s

Medias  

Logs, analytics, datastores MongoDB

Mobile site

CDN CloudFront

Web server

Ngnix

Web server

Ngnix

Infrastructure @ Amazon Web Services

Page 12: Urturn on AWS: scaling infra, cost and time to maket

1 Replica

1 Slave

Urturn Web Back Urturn Front

Js client

Urturn reactive Serving web pages

Rails + Unicorn

Database MySQL

Global  architecture  

Google Analytics GoSquared Mixpannel

New Relic

iPhone app

Yahoo image, Youtube,

SoundCloud, Facebook, Twitter,

Instagram, ...

Mixpanel Google

Analytics

Expressions Apps

Urturn tasks Computing

activities, emails

Rails + Unicorn

Load

bal

ance

rs

Am

azon

Web

Ser

vice

s

Thum

bs

Fire

fox-

base

d

Cac

hing

M

emca

ched

Green= Scales

horizontally

Internal  External  

Fron

t  Ba

ck  

Medias  

Facebook

Logs, counts, analytics… MongoDB

Twitter

Mobile site

CDN CloudFront

Web server

Ngnix

Scout

Web server

Ngnix

1 Slave

Indexation Solr

Mes

sage

s R

esqu

e

Mai

ls

Pos

tFix

Storage AWS S3

Page 13: Urturn on AWS: scaling infra, cost and time to maket

MySQL DB

Urturn clients

Js c

lient

Zoom  on  reacEve  requests  

iPho

ne

App

s

Load

ba

lanc

ers

MongoDB

Mob

ile s

ite

CloudFront

Memcached

Ngn

ix Queue

Rails

/public

Rails

Rails Rails

Caching

Browser

Manifest

Local Storage

Urturn JS cache

FAST SLOW -> $$$$ -> MAX USERS LIMIT LOCAL

Page 14: Urturn on AWS: scaling infra, cost and time to maket

MySQL DB

Urturn clients

Js c

lient

Keep  a  good  experience  during  Overload  

iPho

ne

App

s

Load

ba

lanc

ers

MongoDB

Mob

ile s

ite

CloudFront

Memcached

Ngn

ix Queue

Rails

/public

Rails

Rails Rails

Caching

Browser

Manifest

Local Storage

Urturn JS cache

Monitor  overload  here  •  Serve  those  already  on  the  site  •  Overload  page  to  others  

FAST SLOW -> $$$$ -> MAX USERS LIMIT LOCAL

Page 15: Urturn on AWS: scaling infra, cost and time to maket

MySQL

Urturn clients

Js c

lient

A  good  request  is    a  non-­‐existant  request  

iPho

ne

App

s

Load

ba

lanc

ers

MongoDB

Mob

ile s

ite

CloudFront

Memcached

Ngn

ix Queue

Rails

/public

Rails

Rails Rails

Caching

Browser

Manifest

Local Storage

Urturn JS cache

FAST SLOW -> $$$$ -> MAX USERS LIMIT LOCAL

1   2   3   4  

Page 16: Urturn on AWS: scaling infra, cost and time to maket

MySQL

Load testing

Load  tesEng  

Load

ba

lanc

ers

MongoDB

Grinder in the cloud

Load test scripts

Running on multiple

instances

Memcached

Ngn

ix Queue

Rails

/public

Rails

Rails Rails

FAST SLOW -> $$$$ -> MAX USERS LIMIT LOCAL

Grinder  in  the  cloud  •  Automa6cally  loads  the  

system  to  capacity  •  Make  sure  all  pages  are  

in  the  scripts  

Page 17: Urturn on AWS: scaling infra, cost and time to maket

Leveraging  AWS  

Page 18: Urturn on AWS: scaling infra, cost and time to maket

Reserve  or  not?  Instance  pricing  

0

2000

4000

6000

8000

10000

12000

14000

16000

0 3 6 9 12 15 18 21 24 27 30 33 36

Cos

t (U

SD)

Months

On demand 1y heavy (bill anyway) 3y heavy (bill anyway) Spot

Page 19: Urturn on AWS: scaling infra, cost and time to maket

Spot  instances  

•  AWS  offers  unused  capacity  @’spot’  price  •  Choose  a  maximum  hourly  price,  get  it  at  the  market  price  

•  Loose  your  instance  without  warning  

•  Pinterest  massively  uses  spot  intances  

On-­‐demand  price  

Page 20: Urturn on AWS: scaling infra, cost and time to maket

1 Replica

1 Slave

Urturn Web Back Urturn Front

Js client

Urturn reactive Serving web pages

Rails + Unicorn

Database MySQL

Google Analytics GoSquared Mixpannel

New Relic

iPhone app

Yahoo image, Youtube,

SoundCloud, Facebook, Twitter,

Instagram, ...

Mixpanel Google

Analytics

Expressions Apps

Urturn tasks Computing

activities, emails

Rails + Unicorn

Load

bal

ance

rs

Am

azon

Web

Ser

vice

s

Thum

bs

Fire

fox-

base

d

Cac

hing

M

emca

ched

Green= Scales

horizontally

Internal  External  

Fron

t  Ba

ck  

Medias  

Facebook

Logs, counts, analytics… MongoDB

Twitter

Mobile site

CDN CloudFront

Web server

Ngnix

Scout

Web server

Ngnix

1 Slave

Indexation Solr

Mes

sage

s R

esqu

e

Mai

ls

Pos

tFix

Storage AWS S3

If  we  had  to  do  it  again…  

Page 21: Urturn on AWS: scaling infra, cost and time to maket

1 Replica

1 Slave

Urturn Web Back Urturn client

Js client

Urturn reactive Serving web pages

Rails + Unicorn

Database MySQL

Google Analytics GoSquared Mixpannel

New Relic

iPhone app

Yahoo image, Youtube,

SoundCloud, Facebook, Twitter,

Instagram, ...

Mixpanel Google

Analytics

Expressions Apps

Urturn tasks Computing

activities, emails

Rails + Unicorn

Load

bal

ance

rs

Am

azon

Web

Ser

vice

s

Thum

bs

Fire

fox-

base

d

Cac

hing

M

emca

ched

Green= Scales

horizontally

Internal  External  

Fron

t  Ba

ck  

Medias  

Facebook

Logs, counts, analytics… MongoDB

Twitter

Mobile site

Amazon CloudFront

Web server

Ngnix

Scout

Web server

Ngnix

1 Slave

Indexation Solr

Mes

sage

s R

esqu

e

Mai

ls

Pos

tFix

Amazon S3

DynamoDB

Amazon RDS

Amazon CloudSearch

Am

azon

S

QS

Am

azon

S

ES

Am

azon

E

last

iCac

he

…  we’d  consider  this