Денис Баталов, Принципы построения высоконагруженных...

75

Upload: tanya-denisyuk

Post on 02-Jul-2015

190 views

Category:

Technology


1 download

DESCRIPTION

Детально разберём шесть основных принципов построения высоко-нагруженных веб-приложений с использованием таких сервисов AWS как Route 53, Elastic Load Вalancing, RDS, CloudFront, ElastiCache, DynamoDB и др.

TRANSCRIPT

Page 1: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

[email protected]                      dbatalov  

Page 2: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Поехали!  @awsoblako  

Page 3: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

What  your  users  want…  

Page 4: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

What  your  users  want…  

Fast,  performant  experience  

Page 5: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

What  your  users  want…  

Fast,  performant  experience  

Always  on,  accessible  anywhere  

Page 6: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

What  your  users  want…  

Fast,  performant  experience  

Always  on,  accessible  anywhere  

Personalized  and  rich  applicaIon  

Page 7: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

What  your  users  want…  

Fast,  performant  experience  

Always  on,  accessible  anywhere  

Personalized  and  rich  applicaIon  

Lots  of  new  features  all  of  the  

Ime  

Page 8: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Fast,  performant  experience  

Lots  of  new  features  all  of  the  

Ime  

Always  on,  accessible  anywhere  

Personalized  and  rich  applicaIon  

Powerful  web  applicaIons  

Page 9: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

How?  

Page 10: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Building  powerful  web  applicaIons  

Page 11: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Rule  1:  Service  all  web  requests  

Rule  3:  Handle  requests  at  any  scale  

Rule  4:  Simplify  architecture  with  services  

Rule  5:  Automate  operaIonal  management  

Rule  6:  Leverage  unique  cloud  properIes  

Page 12: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

DNS   ApplicaIon   Data  

Rule  1:  Service  all  web  requests  a)  Make  sure  requests  get  to  your  ‘front  door’    

Page 13: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

DNS   ApplicaIon   Data  Request  

Rule  1:  Service  all  web  requests  a)  Make  sure  requests  get  to  your  ‘front  door’    

Page 14: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

DNS   ApplicaIon   Data  Request  

a)  Make  sure  requests  get  to  your  ‘front  door’    Rule  1:  Service  all  web  requests  

Page 15: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

DNS   ApplicaIon   Data  Request  

…then  this  is  irrelevant  

Clients  can’t  resolve  you?  

Rule  1:  Service  all  web  requests  a)  Make  sure  requests  get  to  your  ‘front  door’    

Page 16: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

DNS   ApplicaIon   Data  Request  

“100%  Available”  

SLA  

Rule  1:  Service  all  web  requests  

Route53  

Feature   Details  

Global   Supported  from  AWS  global  edge  locaIons  for  fast  and  reliable  domain  name  resoluIon  

Scalable   AutomaIcally  scales  based  upon  query  volumes  

Latency  based  rou5ng   Supports  resoluIon  of  endpoints  based  upon  latency,  enabling  mulI-­‐region  applicaIon  delivery  

Integrated   Integrates  with  other  AWS  services  allowing  Route  53  to  front  load  balancers,  S3  and  EC2  

Secure   Integrates  with  IAM  giving  fine  grained  control  over  DNS  record  access  

hhp://aws.amazon.com/route53/sla  

a)  Make  sure  requests  get  to  your  ‘front  door’    

Page 17: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

DNS   ApplicaIon   Data  Request  

Rule  1:  Service  all  web  requests  a)  Make  sure  requests  get  to  your  ‘front  door’  b)  Make  sure  you  open  the  door  when  they  arrive  

Route53  

Page 18: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Region  

DNS   ApplicaIon   Data  Request  

Rule  1:  Service  all  web  requests  

ElasIc  Load  

Balancer   Region  

Availability  Zone  

Availability  Zone  

Availability  Zone  

Availability  Zone  

Route53  

a)  Make  sure  requests  get  to  your  ‘front  door’  b)  Make  sure  you  open  the  door  when  they  arrive  

ElasIc  load  balancing  MulI-­‐availability  zone  MulI-­‐region  

Page 19: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Region  

Rule  1:  Service  all  web  requests  

DNS   ApplicaIon   Data  Request  

Region  

a)  Make  sure  requests  get  to  your  ‘front  door’  b)  Make  sure  you  open  the  door  when  they  arrive  c)  Have  the  data  to  form  a  response  

ElasIc  Load  

Balancer   Region  

Availability  Zone  

Availability  Zone  

Availability  Zone  

Availability  Zone  

Route53  

Page 20: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Region  

Rule  1:  Service  all  web  requests  

DNS   ApplicaIon   Data  Request  

Region  

ElasIc  Load  

Balancer  

Route53  

Region  

Availability  Zone  

Availability  Zone  

Availability  Zone  

Availability  Zone  

a)  Make  sure  requests  get  to  your  ‘front  door’  b)  Make  sure  you  open  the  door  when  they  arrive  c)  Have  the  data  to  form  a  response  

MulI-­‐AZ  RDS  (Master-­‐slave)  Inter-­‐region  replicaIon  Read-­‐replicas    

Page 21: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Rule  1:  Service  all  web  requests  

Rule  3:  Handle  requests  at  any  scale  

Rule  4:  Simplify  architecture  with  services  

Rule  5:  Automate  operaIonal  management  

Rule  6:  Leverage  unique  cloud  properIes  

Page 22: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Page 23: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  

Region  A  

Route53  

Region  B  

Request  

Page 24: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  

Region  A  

Route53  

Region  B  

16ms   92ms  

Request  

Page 25: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  

Region  A  

Route53  

Region  B  

16ms   92ms  

Request  

Page 26: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Region  A  

Route53  

Region  B  

16ms  

Request  Region  A  DNS  entry  

a)  Choose  the  fastest  route  

Page 27: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  

London

Paris

NY

Served from S3 /images/*

3

Served from EC2 *.php

2

Single CNAME www.mysite.com

1

CloudFront  World-­‐wide  content  distribu1on  network  Easily  distribute  content  to  end  users  with  low  latency,  high  data  transfer  speeds,  and  no  commitments.    

Page 28: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Without  CloudFront  EC2  webservers/app  servers  loaded  by  user  requests    

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  

Page 29: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

With  CloudFront  Load  of  user  requests  pushed  into  CloudFront,  EC2  cluster  can  scale  down  

Offload  Scale    Down  

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  

Page 30: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Respon

se  Tim

e  

Server  Load  

Respon

se  Tim

e  

Server  

Load  

Respon

se  Tim

e  

Server  

Load  

No  CDN   CDN  for  StaIc  

Content  

CDN  for  StaIc  &  Dynamic  Content  

Offload  Scale    Down  

a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  

Page 31: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  c)  Cache  it  if  you  can  

ElasICache  Memcached  compa1ble  caching  layer  

Serve  frequently  requested  &  slow  changing  data  from  scalable  cache  clusters  

Reduce  load  on  database  and  other  servers    

Page 32: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  c)  Cache  it  if  you  can  d)  Single  digit  latencies  where  it  mahers  

Scale  Database  Que

ry  Perform

ance  

Desired  consistency,  predictability  

Page 33: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  c)  Cache  it  if  you  can  d)  Single  digit  latencies  where  it  mahers  

Scale  Database  Que

ry  Perform

ance  

Desired  consistency,  predictability  

Actual  degraded  

performance  with  scale  

Page 34: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  c)  Cache  it  if  you  can  d)  Single  digit  latencies  where  it  mahers  

Scale  Database  Que

ry  Perform

ance  

Desired  consistency,  predictability  

Actual  degraded  

performance  with  scale  

Management problems  

Data  sharding  Data  caching  Provisioning  

Cluster  management  Fault  management  

Page 35: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  c)  Cache  it  if  you  can  d)  Single  digit  latencies  where  it  mahers  

Scale  Database  Que

ry  Perform

ance  

Dynamo  DB  Query  Performance  

RelaIonal  Database  Query  

Performance  

DynamoDB  

Low  latency  Large  scale  Zero  admin  

Predictable  performance  

Page 36: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  a)  Choose  the  fastest  route  b)  Offload  your  applicaIon  servers  c)  Cache  it  if  you  can  d)  Single  digit  latencies  where  it  mahers  

Scale  Database  Que

ry  Perform

ance  

Dynamo  DB  Query  Performance   DynamoDB  

Low  latency  Large  scale  Zero  admin  

Predictable  performance  Average  single-­‐digit  milliseconds  server  side  

latencies    

Runs  on  solid  state  drives,  and  is  built  to  maintain  consistent,  fast  latencies  at  any  scale  

Page 37: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Rule  1:  Service  all  web  requests  

Rule  3:  Handle  requests  at  any  scale  

Rule  4:  Simplify  architecture  with  services  

Rule  5:  Automate  operaIonal  management  

Rule  6:  Leverage  unique  cloud  properIes  

Page 38: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  3:  Handle  requests  at  any  scale  a)  Scale  up  

VerIcal  Scaling  From  $0.02/hr  

Basic  unit  of  compute  capacity  Range  of  CPU,  memory  &  local  disk  op1ons  17  Instance  types  available,  from  micro  through  cluster  compute  to  SSD  backed  

Scale  up  with  ElasIc  Compute  Cloud  (EC2)  

Page 39: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  3:  Handle  requests  at  any  scale  a)  Scale  up  b)  Scale  out  

Trigger auto-scaling policy

as-create-auto-scaling-group MyGroup --launch-configuration MyConfig --availability-zones eu-west-1a --min-size 4 --max-size 200

Auto-­‐scaling  Automa1c  re-­‐sizing  of  compute  clusters  based  upon  demand    

Page 40: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Manually    

Send  an  API  call  or  use  CLI  to  launch/terminate  instances  –  Only  need  to  

specify  capacity  change  (+/-­‐)    

By  Schedule    

Scale  up/down  based  on  date  and  Ime  

a)  Scale  up  b)  Scale  out  

By  Policy    

Scale  in  response  to  changing  condiIons,  based  on  user  configured  real-­‐Ime  

monitoring  and  alerts  

Auto-­‐Rebalance    

Instances  are  automaIcally  launched/terminated  to  ensure  the  applicaIon  is  

balanced  across  mulIple  Azs        

Rule  3:  Handle  requests  at  any  scale  

Page 41: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Manually    

Send  an  API  call  or  use  CLI  to  launch/terminate  instances  –  Only  need  to  

specify  capacity  change  (+/-­‐)    

By  Schedule    

Scale  up/down  based  on  date  and  Ime  PreempIve  manual  scaling  of  capacity  

 

e.g.  before  a  marke1ng  event  add  10  more  instances  

Regular  scaling  up  and  down  of  instances  

 

e.g.  scale  from  0  to  2  to  process  SQS  messages  every  night  or  double  capacity  

on  a  Friday  night  

a)  Scale  up  b)  Scale  out  

By  Policy    

Scale  in  response  to  changing  condiIons,  based  on  user  configured  real-­‐Ime  

monitoring  and  alerts  

Auto-­‐Rebalance    

Instances  are  automaIcally  launched/terminated  to  ensure  the  applicaIon  is  

balanced  across  mulIple  Azs        

Rule  3:  Handle  requests  at  any  scale  

Dynamic  scale  based  upon  custom  metrics  

 

e.g.  SQS  queue  depth,  Average  CPU  load,  ELB  latency  

Maintain  capacity  across  availability  zones  

 

e.g.  Instance  availability  maintained  in  event  of  AZ  becoming  unavailable  

Page 42: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  3:  Handle  requests  at  any  scale  a)  Scale  up  b)  Scale  out  c)  Dial  it  up  

ElasIc  Block  Store  Provisioned  IOPS  up  to  4000  per  EBS  

volume  Predictable  performance  for    demanding  workloads  such  as  

databases  

DynamoDB  Provisioned  read/write  performance  per  

table  Predictable  high  performance  scaled  via  

console  or  API  

Page 43: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS
Page 44: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

“AWS  gave  us  the  flexibility  to  bring  a  massive  amount  of  capacity  online  in  a  short  period  of  

Ime  and  allowed  us  to  do  so  in  an  operaIonally  straighvorward  way.  

 AWS  is  now  Shazam’s  cloud  provider  of  choice,”    

 Jason  Titus,  

CTO  

DynamoDB:    over  500,000  writes  per  

second    

Amazon  EMR:  more  than  1  million  writes  

per  second  

Page 45: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Rule  1:  Service  all  web  requests  

Rule  3:  Handle  requests  at  any  scale  

Rule  4:  Simplify  architecture  with  services  

Rule  5:  Automate  operaIonal  management  

Rule  6:  Leverage  unique  cloud  properIes  

Page 46: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Your  Business  

70%  

On-­‐Premise  Infrastructure  

30%  

Managing  All  of  the    “UndifferenIated  Heavy  Li{ing”  

Rule  4:  Simplify  architecture  with  services  

Page 47: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

AWS  Cloud-­‐Based  

Infrastructure  

Your  Business  

More  Time  to  Focus  on  Your  Business  

Configuring  Your  Cloud  Assets  

70%  

30%  70%  

On-­‐Premise  Infrastructure  

30%  

Managing  All  of  the    “UndifferenIated  Heavy  Li{ing”  

Rule  4:  Simplify  architecture  with  services  

Page 48: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

RelaIonal  Database  Service  Database-­‐as-­‐a-­‐Service  

No  need  to  install  or  manage  database  instances  

Scalable  and  fault  tolerant  configura1ons  

DynamoDB  Provisioned  throughput  NoSQL  database  

Fast,  predictable  performance  

Fully  distributed,  fault  tolerant  architecture  

Use  RDS  for  databases  

Use  DynamoDB  for  high  performance  key-­‐

value  DB  

Rule  4:  Simplify  architecture  with  services  

Page 49: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Amazon  SQS  

Processing  task/processing  trigger  

Processing  results  

Amazon  SQS  Reliable,  highly  scalable,  queue  service  

for  storing  messages  as  they  travel  

between  instances  

Task  A  

Task  B  (Auto-­‐scaling)  

Task  C  

2

3

1

Simple  Workflow  Reliably  coordinate  processing  steps  

across  applica1ons  

Integrate  AWS  and  non-­‐AWS  resources  Manage  distributed  state  in  complex  

systems  

Push  inter-­‐process  workflows  into  the  cloud  with  SWF  

Reliable  message  queuing  without  

addiIonal  so{ware  

Rule  4:  Simplify  architecture  with  services  

Page 50: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Cloud  Search  Elas1c  search  engine  based  upon  

Amazon  A9  search  engine  

Fully  managed  service  with  sophis1cated  feature  set  

Scales  automa1cally  

Document  Server    

Results  

Search  Server  

Don’t  install  search  so{ware,  use  CloudSearch  

Process  large  volumes  of  data  cost  effecIvely  

with  EMR  

ElasIc  MapReduce  Elas1c  Hadoop  cluster  

Integrates  with  S3  &  DynamoDB  

Leverage  Hive  &  Pig  analy1cs  scripts  Integrates  with  instance  types  such  as  

spot  

Rule  4:  Simplify  architecture  with  services  

Page 51: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS
Page 52: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

“Amazon  CloudSearch  is  a  game-­‐changing  product  that  has  allowed  us  to  deliver  powerful  new  search  capabiliIes.  Our  customers  can  now  find  what  they  are  looking  for  faster  and  more  

easily  than  ever  before…    

….We  saved  many  months  of  re-­‐architecture  and  development  Ime  by  going  with  Amazon  

CloudSearch”    

Don  MacAskill  CEO  &  Chief  Geek  

SmugMug  

Page 53: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS
Page 54: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS
Page 55: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Rule  1:  Service  all  web  requests  

Rule  3:  Handle  requests  at  any  scale  

Rule  4:  Simplify  architecture  with  services  

Rule  5:  Automate  operaIonal  management  

Rule  6:  Leverage  unique  cloud  properIes  

Page 56: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Compute  

Storage  

Security   Scaling  

Database  

Networking  Monitoring  

Messaging  

Workflow  

DNS  Load  Balancing  

Backup  CDN  

Rule  5:  Automate  operaIonal  management  a)  Everything  is  programmable  

Access  everything  via  CLI,  API  or  

Console  

Achieve  the  highest  levels  of  automaIon  

sophisIcaIon  with  ease  

Page 57: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  5:  Automate  operaIonal  management  a)  Everything  is  programmable  b)  Think  disposable,  one  click  deployments  

Cloud  FormaIon  Automate  crea1on  of  ‘stacks’  in  a  repeatable  way  

Scrip1ng  framework  for  AWS  resource  crea1on  

Feature   Details  

PlaCorm  support   Support  for  AWS  resources  from  EC2  to  IAM  

Resource  crea5on   Creates  AWS  resources  behind  the  scenes  and  reports  on  progress  

Declara5ve   Specify  stacks  in  JSON  format  and  source  control  your  environments  

Customizable   Drive  stack  creaIon  with  paramaters  

Page 58: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  5:  Automate  operaIonal  management  a)  Everything  is  programmable  b)  Think  disposable,  one  click  deployments  c)  Design  for  failure,  implement  self  healing  

Customize  instance  startup  

 

Get  instances  to  ask  ‘who  am  I?’  quesIon  on  startup  and  be  configured  dynamically  upon  

being  asnwered    

Maintain  capacity  of  instances  

 

Using  a  minimum  pool  size  will  maintain  

capacity  in  the  event  of  instance  failures  

Know  what’s  going  on,  take  automated  acIons  

 

Use  CloudWatch  standard  and  custom  metrics  to  create  

alarms.      

Respond  with  automated  administraIon  acIons  

Bootstrapping Auto-scaling Cloud Watch

Page 59: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  5:  Automate  operaIonal  management  a)  Everything  is  programmable  b)  Think  disposable,  one  click  deployments  c)  Design  for  failure,  implement  self  healing  

Page 60: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Rule  1:  Service  all  web  requests  

Rule  3:  Handle  requests  at  any  scale  

Rule  4:  Simplify  architecture  with  services  

Rule  5:  Automate  operaIonal  management  

Rule  6:  Leverage  unique  cloud  properIes  

Page 61: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  6:  Leverage  unique  cloud  properIes  a)  OpImize  costs  with  instance  types  

Page 62: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Unix/Linux  instances  start  at  $0.02/hour    

Pay  as  you  go  for  compute  power    

Low  cost  and  flexibility      

Pay  only  for  what  you  use,  no  up-­‐front  commitments  or  long-­‐term  contracts  

 Use  Cases:  

 Applica1ons  with  short  term,  spiky,  or  

unpredictable  workloads;    

Applica1on  development  or  tes1ng    

On-demand instances

1-­‐  or  3-­‐year  terms    

Pay  low  up-­‐front  fee,  receive  significant  hourly  discount  

 Low  Cost  /  Predictability  

 Helps  ensure  compute  capacity  is  available  

when  needed      

Use  Cases:    

Applica1ons  with  steady  state  or  predictable  usage    

Applica1ons  that  require  reserved  capacity,  including  disaster  recovery  

Reserved instances

Bid  on  unused  EC2  capacity      

Spot  Price  based  on  supply/demand,  determined  automaIcally  

 Cost  /  Large  Scale,  dynamic  workload  handling  

     

Use  Cases:    

Applica1ons  with  flexible  start  and  end  1mes    

Applica1ons  only  feasible  at  very  low  compute  prices    

Spot instances

Rule  6:  Leverage  unique  cloud  properIes  a)  OpImize  costs  with  instance  types  

Page 63: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

0

1000

2000

3000

4000

5000

6000

7000

Reserved Instances

On Demand

Spot

Rule  6:  Leverage  unique  cloud  properIes  a)  OpImize  costs  with  instance  types  

Page 64: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

a)  OpImize  costs  with  instance  types  b)  Get  insight  fast  with  ElasIc  MapReduce  

Rule  6:  Leverage  unique  cloud  properIes  

ElasIc  MapReduce  Managed,  elas1c  Hadoop  cluster  Integrates  with  S3  &  DynamoDB  

Leverage  Hive  &  Pig  analy1cs  scripts  

Integrates  with  instance  types  such  as  spot  

Feature   Details  

Scalable   Use  as  many  or  as  few  compute  instances  running  Hadoop  as  you  want.  Modify  the  number  of  instances  while  your  job  flow  is  running    

Integrated  with  other  services  

Works  seamlessly  with  S3  as  origin  and  output.  Integrates  with  DynamoDB  

Comprehensive   Supports  languages  such  as  Hive  and  Pig  for  defining  analyIcs,  and  allows  complex  definiIons  in  Cascading,  Java,  Ruby,  Perl,  Python,  PHP,  R,  or  C++  

Cost  effec5ve   Works  with  Spot  instance  types  

Monitoring   Monitor  job  flows  from  with  the  management  console  

Page 65: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

a)  OpImize  costs  with  instance  types  b)  Get  insight  fast  with  ElasIc  MapReduce  

ElasIc    MapReduce  

Code   Name    node  

Output  S3  +  SimpleDB  

S3  +  DynamoDB  

ElasIc  cluster  

HDFS  Queries  +  BI  

Via  JDBC,  Pig,  Hive  

Input  data  

Rule  6:  Leverage  unique  cloud  properIes  

Page 66: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Features  powered  by  Amazon  ElasIc  MapReduce:  

 People  Who  Viewed  this  Also  Viewed  

Review  highlights  Auto  complete  as  you  type  on  search  

Search  spelling  sugges1ons  Top  searches  

Ads    

200  ElasIc  MapReduce  jobs  per  day  Processing  3TB  of  data  

Page 67: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

“With  AWS,  our  developers  can  now  do  things  they  couldn’t  before…  

 …Our  systems  team  can  focus  their  energies  on  other  

challenges.”    

Dave  Marin  Search  and  data-­‐mining  engineer  

Page 68: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Cluster  compute  instances  Implement  HVM  process  execu1on  Intel®  Xeon®  E5-­‐2670  processors  10  Gigabit  Ethernet  

Cluster Compute

80 EC2 Compute Units

60GB RAM

3TB Local Disk

Network  placement  groups  Cluster  instances  deployed  in  a  ‘Placement  Group’  enjoy  low  

latency,  full  bisec1on  10  Gbps  bandwidth  

10Gbps

Rule  6:  Leverage  unique  cloud  properIes  a)  OpImize  costs  with  instance  types  b)  Get  insight  fast  with  ElasIc  MapReduce  c)  Create  a  supercomputer  backend  when  you  need  it  

Page 69: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Rule  2:  Service  requests  as  fast  as  possible  

Rule  1:  Service  all  web  requests  

Rule  3:  Handle  requests  at  any  scale  

Rule  4:  Simplify  architecture  with  services  

Rule  5:  Automate  operaIonal  management  

Rule  6:  Leverage  unique  cloud  properIes  

Page 70: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

What  your  users  want…  

Fast,  performant  experience  

Lots  of  new  features  all  of  the  

Ime  

Always  on,  accessible  anywhere  

Personalized  and  rich  applicaIon  

Page 71: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

With  AWS  

ElasIc  uIlity  capacity  

✔  

Lots  of  new  features  all  of  the  

Ime  

Always  on,  accessible  anywhere  

Personalized  and  rich  applicaIon  

Page 72: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

With  AWS  

ElasIc  uIlity  capacity  

✔   Highly  available  global  coverage  

✔  

Lots  of  new  features  all  of  the  

Ime  

Personalized  and  rich  applicaIon  

Page 73: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

With  AWS  

ElasIc  uIlity  capacity  

✔   Highly  available  global  coverage  

✔  

Personalized  and  rich  applicaIon  

Agility  &  automated  operaIons  

✔  

Page 74: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

With  AWS  

ElasIc  uIlity  capacity  

✔   Highly  available  global  coverage  

✔  

Agility  &  automated  operaIons  

✔   Cost  effecIve  storage,  big  data  &    

analyIcs  ✔  

Page 75: Денис Баталов, Принципы построения высоконагруженных сайтов на платформе АWS

Дзякую!  

Free to try

New AWS accounts receive 12 months of

AWS Free Tier access

Self-Paced Labs

aws.amazon.com/training/ self-paced-labs

Try products, gain new skills, and get hands-on

practice working with AWS technologies

aws.amazon.com/training

Training

Skill up and gain confidence to design, develop, deploy and

manage your applications on AWS

aws.amazon.com/free

@awsoblako   @dbatalov