Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

AWS Cloud Kata | Taipei - Getting to Scale


Published on

Published in: Technology

AWS Cloud Kata | Taipei - Getting to Scale

  1. 1. Getting to Scale
  2. 2. 503 Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
  3. 3. With AWS, scale from one instance…
  4. 4. …to thousands Fully automated!
  5. 5. How do I scale my architecture to support my first 10M users?
  6. 6. “Think Big, Start Small, Scale Fast” Eric Ries, author of NY Times bestseller “The Lean Startup”
  7. 7. Idea MVP Scale Profitability 01 02 03 04
  8. 8. Getting to Scale By building a scalable Architecture to support your first 10M users
  9. 9. 1.  Dev  &  Test   3.  Beta  Release   2.  Alpha  Release  
  10. 10. Production 1.0 Architecture
  11. 11. Database Options Self-Managed Database Server on Amazon EC2 Your choice of database running on Amazon EC2 Bring Your Own License (BYOL) Fully-Managed Amazon RDS Relational Database as a managed service Flexible licensing: BYOL or License Included Amazon DynamoDB Managed NoSQL database service using SSD storage Seamless scalability Zero administration
  12. 12. But how do I choose what DB technology I need? SQL? NoSQL?
  13. 13. Some folks won’t like this. But…
  14. 14. Start with SQL databases
  15. 15. But, but, but, but…
  16. 16. No. You don’t.
  17. 17. Start with SQL databases
  18. 18. Why SQL? Established and well worn technology Lots of existing code, communities, books, tools, etc Clear patterns to scalability You aren’t going to break SQL DBs in your first 10 million users. No really, you won’t
  19. 19. Amazon  Rela&onal  Database  Service  (RDS)   Feature   Pla9orm  support   Preconfigured   Automated  patching   Details   Create  MySQL,  SQL  Server  and  Oracle   Get  started  instantly  with  sensible  default   seAngs   Keep  your  database  plaEorm  up  to  date   automa&cally   Backups   Failover   •  Database-as-a-Service •  No need to install or manage database instances •  Scalable and fault tolerant configurations Automa&c  backups  and  point  in  &me   recovery  using  snapshots   Manual  DB  snapshots   Automated  failover  to  slave  hosts  in  event  of   a  failure   ReplicaBon   Easily  create  read-­‐replicas  of  your  data  and   seamlessly  replicate  data  across  availability   zones  
  20. 20. Auto-Scaling Automatic resizing of compute clusters based on demand Feature   Amazon   CloudWatch   Trigger  auto-­‐scaling  policy   Details   Control   Define  minimum  and  maximum  instance  pool   sizes  and  when  scaling  and  cool  down  occurs.   Integrated  to  Amazon   CloudWatch   Use  metrics  gathered  by  CloudWatch  to  drive   scaling.   Instance  types   Run  Auto  Scaling  for  On-­‐Demand  and  Spot   Instances.  Compa&ble  with  VPC.   as-create-auto-scaling-group MyGroup --launch-configuration MyConfig --availability-zones us-east-1a --min-size 4 --max-size 200
  21. 21. ProducBon  1.0   Architecture  
  22. 22. Production 1.0 Architecture Well-­‐designed,  2  Tier  architecture   Highly  Available  due  to  Mul&ple  Availability  Zone   Load  Balancing  &  Auto-­‐Scaling  for  full  scalability   Fully  managed  Database  included     Capable  of  serving  >10K-­‐100Ks  users    
  23. 23. BUT…
  24. 24. Production 1.0 Architecture Wasted  server  capacity  for  sta&c  content   Reliability  and  durability  are  not  yet  op&mal   End-­‐user  experience  could  be  improved  thru   offloading  &  caching  
  25. 25. SO…
  26. 26. Let’s add Simple Storage Service (S3) CloudFront to optimize the end-user experience
  27. 27. Simple Storage Service (S3) Feature   Flexible  object  store   Access  control   Server-­‐side  encrypBon   MulB-­‐part  uploads   Object  versioning   Object  expiry   Durable storage, any object 99.999999999% durability of objects Unlimited storage of objects of any type Up to 5TB size per object Access  logging   Web  content  hosBng   NoBficaBons   Import/Export   Details   Buckets  act  like  drives,  folder  structures  within   Granular  control  over  object  permissions   256bit  AES  encryp&on  of  objects   Improved  throughput  &  control   Archive  old  objects  and  version  new  ones   Automa&cally  remove  old  objects   Full  audit  log  of  bucket/object  ac&ons   Serve  content  as  web  site  with  built  in  page  handling   Receive  no&fica&ons  on  key  events   Physical  device  import/export  service  
  28. 28.  CloudFront   •  World-wide content distribution network •  Easily distribute content to end users with low latency, high data transfer speeds, and no commitments Feature   Fast   Integrated  with  other  services   Dynamic  content   Streaming   Details   Mul&ple  world-­‐wide  edge  loca&ons  to  serve  content  as  close  to  your  users  as  possible   Works  seamlessly  with  S3  and  EC2  origin  servers   Supports  sta&c  and  dynamic  content  from  origin  servers   Supports  rtmp  from  S3  and  includes  support  for  live  streaming  from  Adobe  FMS  and  Microsod   Media  Server  
  29. 29. Production 1.2 Architecture
  30. 30. Production 1.2 Architecture Well-­‐designed,  2  Tier  architecture   Highly  Available  due  to  Mul&ple  Availability  Zone   Load  Balancing  &  Auto-­‐Scaling  for  full  scalability   Fully  managed  Database  included     Sta&c  content  stored  in  durable,  consistent  way   Improved  end-­‐user  experience  through  CDN   Capable  of  serving  >100K-­‐1M+  users  
  31. 31. BUT…
  32. 32. Production 1.2 Architecture You are now at Scale… …with lots of data… …and need to optimize continuously. But how and where?
  33. 33. SO…
  34. 34. Let’s add Big Data for analytics of web, mobile, gaming, and log data
  35. 35. Multiple managed AWS services for Big Data
  36. 36. Elastic MapReduce (EMR) •  Managed, elastic Hadoop cluster •  Integrates with S3 & DynamoDB •  Leverage Hive & Pig analytics scripts Feature   Scalable   Integrated  with  other   services   Comprehensive   Cost  effecBve   Monitoring   Details   Use  as  many  or  as  few  compute  instances  running  Hadoop  as  you  want.  Modify  the  number  of   instances  while  your  job  flow  is  running     Works  seamlessly  with  S3  as  origin  and  output.  Integrates  with  DynamoDB   Supports  languages  such  as  Hive  and  Pig  for  defining  analy&cs,  and  allows  complex  defini&ons  in   Cascading,  Java,  Ruby,  Perl,  Python,  PHP,  R,  or  C++   Works  with  Spot  instance  types   Monitor  job  flows  from  with  the  management  console  
  37. 37. Foursquare… …generates a lot of Data Founded in 2009 112M in Venture Capital 33 million users 1.3 million businesses using the service 3.5 billion check-ins 15M+ venues, Terabytes of log data
  38. 38. Uses EMR for Evaluation of new features Machine learning Exploratory analysis Daily customer usage reporting Long-term trend analysis
  39. 39. Benefits of EMR Ease-of-Use “We have decreased the processing time for urgent data-analysis” Flexibility To deal with changing requirements & dynamically expand reporting clusters Costs “We have reduced our analytics costs by over 50%”
  40. 40. Production 1.3 Architecture
  41. 41. Production 1.3 Architecture Well-­‐designed,  2  Tier  architecture   Highly  Available  due  to  Mul&ple  Availability  Zone   Load  Balancing  &  Auto-­‐Scaling  for  full  scalability   Sta&c  content  stored  in  durable,  consistent  way   Improved  end-­‐user  experience  through  CDN   Big  Data  analy&cs  built  in  for  con&nuous  op&miza&on   Capable  of  serving  >1m-­‐10M+  users  
  42. 42. DEMO   GeVng  to  Scale  
  43. 43. Thank You­‐ups  
  44. 44. Taipei 台北 Inside the Development of Cubie Co-founder 馮彥文 Yenwen Feng AWS Cloud Kata for Start-Ups and Developers
  45. 45. What’s Cubie? "   Mobile messaging service "   Mar-12 launched AWS Cloud Kata for Start-Ups and Developers
  46. 46. ~9M Downloads Millions Downloads 10 9 8 7 6 5 4 3 2 1 0 Mar-12 Apr-12 May-12 Jun-12 Jul-12 Aug-12 Sep-12 Oct-12 Nov-12 AWS Cloud Kata for Start-Ups and Developers Dec-12 Jan-13 Feb-13 Mar-13 Apr-13 May-13 Jun-13 Jul-13 Aug-13 Sep-13
  47. 47. # 1 in Social in 16 Countries, # 2~20 in Social in 38 Countries AWS Cloud Kata for Start-Ups and Developers
  48. 48. Development Team "   4→6 Engineers •  4 Server-side •  6 Android •  4 iOS "   Pair programming •  Knowledge sharing AWS Cloud Kata for Start-Ups and Developers
  49. 49. Development Team "   Time to market •  Picking features •  Development Tools •  Infrastructure: AWS AWS Cloud Kata for Start-Ups and Developers
  50. 50. Development Tools " Trello •  Limit your todo list •  Only do things fit in screen AWS Cloud Kata for Start-Ups and Developers
  51. 51. Development Tools " Mixpanel •  Segmentation •  Funnels •  Retention AWS Cloud Kata for Start-Ups and Developers
  52. 52. Cubie Architecture "   Built by ourselves •  Messaging servers, protocols, VOIP, ... Client "   Goals Messaging Servers Elastic Load Balancing CloudFront Route 53 Amazon S3 Cassandra HTTP Servers AWS Cloud Kata for Start-Ups and Developers •  Simplicity •  No single point of failure •  Scaling •  Latency
  53. 53. AWS EC2 "   Scale up by script Amazon EC2 •  Auto-deploy, upgrade using AWS APIs •  Mar-12: 3 messaging servers, 3 Cassandras •  Apr-12: 9 messaging servers, 18 Cassandras "   Cost saving •  Find the correct instance type •  Reserved instances "   Fault tolerance AWS Cloud Kata for Start-Ups and Developers
  54. 54. Cassandra on AWS EC2 "   Disk usage Amazon EC2 •  Mar-12: EBS •  Apr-12: Local hard disk •  EBS with Provisioned IOPS AWS Cloud Kata for Start-Ups and Developers
  55. 55. AWS S3 " CloudFront •  Website, Stickers, ... "   S3 Amazon S3 •  Photos, drawings, ... "   S3 Regions •  US Standard & others CloudFront "   S3 Client-side development •  Token vending machine •  Server encrypting •  No javascript SDK AWS Cloud Kata for Start-Ups and Developers
  56. 56. Cassandra "   9 + 3 servers total •  9 in production •  3 backups "   Provisioned IOPS "   Vs Dynamo DB •  Local testing •  Platform independent Cassandra AWS Cloud Kata for Start-Ups and Developers
  57. 57. Messaging Servers "  Built by akka •  Auto discovery •  100k~200k per instance "  Fault tolerance Messaging Servers •  Master slave AWS Cloud Kata for Start-Ups and Developers
  58. 58. HTTP Servers "   Spring framework •  Service config, preference, ... •  Use HTTP services if we can HTTP Servers AWS Cloud Kata for Start-Ups and Developers
  59. 59. THANKS, search: cubie iOS, Android, Web AWS Cloud Kata for Start-Ups and Developers