O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Escalando hasta sus primeros 10 millones de usuarios

21 visualizações

Publicada em

AWS Cloud Experience Chile - TRACK A1

Publicada em: Tecnologia
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto

Escalando hasta sus primeros 10 millones de usuarios

  1. 1. Escalando hasta sus primeros 10 millones de usuarios Laura Caicedo Arquitecta de Soluciones para Partners, AWS Colombia #AWSCloudExperience
  2. 2. Disclaimer • WildRydes o Unicornal Rental es una historia de una empresa ficticia
  3. 3. Now that’s a lot of things to read! This is NOT where we want to start!
  4. 4. It’s not the single thing that fixes everything.
  5. 5. What do we need first?
  6. 6. AWS building blocks Inherently highly scalable, available and fault-tolerant services Highly scalable, available with the right architecture a Amazon CloudFront a Amazon Route 53 a Amazon S3 a Amazon DynamoDB a Elastic Load Balancing a AWS Lambda a Amazon EFS a Amazon SQS a Amazon SNS a Amazon SES a AWS Step Functions a … a Amazon EC2 a Amazon EBS a Amazon RDS a Amazon VPC
  7. 7. Build Measure Learn
  8. 8. Me
  9. 9. 1 User Amazon EC2 instance Elastic IP User Amazon Route 53
  10. 10. Lightsail: the easiest way to get started on AWS • Choose from five plans that include bundled compute, storage, and networking • Benefit from a low, predictable price • Spin up a fully configured server in seconds • Manage from the intuitive Lightsail console • Scale with access to AWS services • Automate with Lightsail API & CLI
  11. 11. “We’re gonna need a bigger box” • Simplest approach • Can now leverage PIOPS • High I/O instances • High memory instances • High CPU instances • High storage instances • Easy to change instance sizes • Will hit an endpoint eventually c4.8xlarge m4.2xlarge t2.micro
  12. 12. 1 User Amazon EC2 instance Elastic IP User Amazon Route 53• No failover • No redundancy • Too many eggs in one basket
  13. 13. Users > 1
  14. 14. Users > 1 Amazon EC2 instance Elastic IP User Amazon Route 53 Database Instance
  15. 15. Database options Self-managed Fully managed Amazon EC2 Amazon DynamoDB Amazon RDS Amazon Redshift
  16. 16. Amazon Aurora • MySQL or Postgres compatible • Automatic storage scaling (up to 64 TB) • Up to 15 read-replicas • Continuous (incremental) backups to Amazon S3 • 6-way replication across 3 zones
  17. 17. Users > 100 Amazon EC2 instance Elastic IP User Amazon Route 53 Amazon RDS DB instance
  18. 18. To NOSQL, or no to NoSQL?
  19. 19. Why start with SQL? • Established and well-worn technology. • Lots of existing code, communities, books, and tools. • You aren’t going to break SQL DBs in your first millions of users. No, really, you won’t.* • Clear patterns to scalability. *Unless you are doing something SUPER peculiar with the data or you have MASSIVE amounts of it. …but even then SQL will have a place in your stack.
  20. 20. MY DATA IS HUGE (I wish…)
  21. 21. > 5 TB in year one? Incredibly data intensive workload? OK! You might need NoSQL.
  22. 22. Why else might you need NoSQL? • TB of data • Super low-latency applications • Nonrelational, schema-less* data • Rapid ingest of data (thousands of records/sec) • Metadata-driven datasets *Need!= “It’s easier to do dev without schemas”
  23. 23. Users >1 Registration, Sign In, etc
  24. 24. Amazon Cognito Manage authenticated and guest users’ access to your AWS resources Federated Identities Add sign-up and sign-in with a fully managed user directory User Pool Guest Your own auth
  25. 25. Users > 100
  26. 26. Users > 100 User Amazon Route 53 Web Instance Amazon RDS DB Instance Active (Multi-AZ) Web Instance Amazon RDS DB Instance Standby (Multi-AZ) Load balancer
  27. 27. Load Balancers Classic Load BalancerApplication Load Balancer Network Load Balancer
  28. 28. Application Load Balancer • Highly available • 1 - 65535 • Content-based routing • Container-based apps • WebSockets • HTTP/2 RECOMMENDED
  29. 29. Network Load Balancer • Layer 4 • Extreme performance • Ultra-low latency • Volatile workloads • Static IP • Elastic IP • Preserve source IP
  30. 30. Users > 100000
  31. 31. horizontally vertically
  32. 32. Users > 10000s – 100000s Amazon RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone Amazon RDS DB Instance Standby (Multi-AZ) Amazon RDS DB Instance Read Replica Amazon RDS DB Instance Read Replica Amazon RDS DB Instance Read Replica Amazon RDS DB Instance Read Replica Web Instance Web Instance Web Instance Web Instance Web Instance Web Instance Web Instance Web Instance Amazon Route 53 User ? ? ?
  33. 33. Amazon Simple Storage Service (S3) • Object-based storage • Highly durable • Great for static assets • “Infinitely scalable” • Objects up to 5 TB • Encryption
  34. 34. Amazon CloudFront • Cache content for faster delivery • Dynamic and static content • Streaming video • Custom SSL certificates • Low TTLs (as short as 0 seconds) • Optimized for AWS ResponseTime ServerLoad Response Time Server Load Response Time Server Load No CDN CDN for Static Content CDN for Static & Dynamic Content
  35. 35. Shift some load around Amazon RDS DB Instance Active (Multi-AZ) Availability Zone Load balancer Amazon S3 Amazon CloudFront Amazon Route 53User Web Instances Availability Zone Web Instances Amazon RDS DB Instance Standby (Multi-AZ)
  36. 36. Caching…. Amazon RDS DB Instance Active (Multi-AZ) Availability Zone Load balancer Amazon S3 Amazon CloudFront Amazon Route 53 User Web Instances Amazon ElastiCache
  37. 37. Amazon ElastiCache • Managed Memcached or Redis • Scale from one to many nodes • Self-healing (replaces dead instance) • Single digit ms speeds (usually) • Local to a single AZ for Memcache • Multi-AZ possible with Redis
  38. 38. MY DATA IS HUGE
  39. 39. Shift some load around Amazon RDS DB Instance Active (Multi-AZ) Availability Zone Load balancer Amazon S3 Amazon CloudFront Amazon Route 53 User Web Instances Amazon ElastiCache Amazon DynamoDB
  40. 40. Amazon DynamoDB • Managed NoSQL database • Provisioned throughput • Fast, predictable performance • Fully distributed, fault tolerant • JSON support • Items up to 400 KB • Time-to-live (TTL) • Streams and Triggers • AWS Application Auto Scaling!!
  41. 41. Amazon DynamoDB • Managed NoSQL database • Provisioned throughput • Fast, predictable performance • Fully distributed, fault tolerant • JSON support • Items up to 400 KB • Time-to-live (TTL) • Streams and Triggers • AWS Application Auto Scaling!! AWS Database Migration Service!!
  42. 42. Now that our web tier is much more lightweight, we can revisit the beginning of our talk…
  43. 43. Auto Scaling!
  44. 44. Sunday Monday Tuesday Wednesday Thursday Friday Saturday Typical weekly traffic to UnicornalRental
  45. 45. Sunday Monday Tuesday Wednesday Thursday Friday Saturday Provisioned capacity Typical weekly traffic to UnicornalRental
  46. 46. December Holidays traffic to UnicornalRental
  47. 47. Provisioned capacity December Holidays traffic to UnicornalRental
  48. 48. 76% 24% Provisioned capacity December Holidays traffic to UnicornalRental
  49. 49. December Holidays traffic to UnicornalRental
  50. 50. Auto Scaling lets you do this!
  51. 51. Auto Scaling Automatic resizing of compute clusters Define min/max pool sizes CloudWatch metrics drive scaling On-Demand or Spot Instances aws autoscaling create-auto-scaling-group --auto-scaling-group-name MyGroup --launch-configuration-name MyConfig --min-size 4 --max-size 200 --availability-zones us-west-2c, us-west-2b
  52. 52. Users > 500000
  53. 53. Users > 500,000s Amazon RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone Amazon RDS DB Instance Standby (Multi-AZ) Amazon RDS DB Instance Read Replica Amazon RDS DB Instance Read Replica Web Instance Web Instance Web Instance Web Instance Web Instance Web Instance Web Instance Web Instance Amazon Route 53User Amazon S3 Amazon CloudFront Amazon DynamoDBAmazon ElastiCache Amazon ElastiCache
  54. 54. Use automation
  55. 55. AWS Code Services Source Build Test Production Third Party Tooling Software Release Steps: AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS CodePipeline
  56. 56. Users > 500,000+ • Monitoring, metrics, and logging • If you can’t build it internally, outsource it! (third-party SaaS) • What are customers saying? • Try to squeeze as much performance out of each service/component
  57. 57. AGGREGATE LEVEL METRICS LOG ANALYSIS EXTERNAL SITE PERFORMANCE HOST LEVEL METRICS
  58. 58. DON’T REINVENT THE WHEEL • Email • Queuing • Transcoding • Search • Databases • Monitoring • Metrics • Logging • Compute Amazon SQSAmazon SNS Amazon Elastic Transcoder AWS Step FunctionsAmazon SESAWS Lambda Amazon Elastic Search Amazon API Gateway Loose coupling + Serverless = winning
  59. 59. The looser they're coupled, the bigger they scale • Independent components • Design everything as a black box • Decouple interactions • Favor services with built-in redundancy and scalability • Don’t build your own! S3 bucket Lambda Push: event notification DynamoDB Pull: DynamoDB Stream Amazon Kinesis Amazon SQS messages Get message Instance Put message Instance Amazon SNS Topic Publish notification Queue is subscribed to topic Pull: Amazon Kinesis stream Loose coupling sets you free!
  60. 60. The Microservices Architecture
  61. 61. • Identify performance bottlenecks and errors • Pinpoint issues to specific service(s) in your application • Identify impact of issues on users of the application • Visualize the service call graph of your application AWS X-Ray
  62. 62. Visualize service call graph
  63. 63. Trace
  64. 64. Users > 1,000,000
  65. 65. OUR PORTFOLIO Creativity is the key to success in the future, and primary education is where teachers can bring creativity in children at that level keep growing lorem ipsum dolor sit amet.
  66. 66. OUR PORTFOLIO Creativity is the key to success in the future, and primary education is where teachers can bring creativity in children at that level keep growing lorem ipsum dolor sit amet.
  67. 67. OUR PORTFOLIO Creativity is the key to success in the future, and primary education is where teachers can bring creativity in children at that level keep growing lorem ipsum dolor sit amet.
  68. 68. OUR PORTFOLIO Creativity is the key to success in the future, and primary education is where teachers can bring creativity in children at that level keep growing lorem ipsum dolor sit amet.
  69. 69. OUR PORTFOLIO Creativity is the key to success in the future, and primary education is where teachers can bring creativity in children at that level keep growing lorem ipsum dolor sit amet.
  70. 70. OUR PORTFOLIO Creativity is the key to success in the future, and primary education is where teachers can bring creativity in children at that level keep growing lorem ipsum dolor sit amet.
  71. 71. OUR PORTFOLIO Creativity is the key to success in the future, and primary education is where teachers can bring creativity in children at that level keep growing lorem ipsum dolor sit amet.
  72. 72. Reaching a million and above is going to require some bit of all the previous things: • Multi-AZ • Elastic Load Balancing between tiers • Auto Scaling • Microservices • Serving content smartly (Amazon S3/CloudFront) • Caching off DB • Moving state off tiers that auto scale Users >1 million+
  73. 73. Amazon RDS DB Instance Active (Multi-AZ) Availability Zone Amazon RDS DB Instance Read Replica Amazon RDS DB Instance Read Replica Web Instance Web Instance Web Instance Web Instance User Amazon S3 Amazon DynamoDB Amazon SQS ElastiCache Worker Instance Worker Instance Amazon CloudWatch Internal App Instance Internal App Instance Amazon SES AWS Lambda Amazon Route 53 Amazon CloudFront Load balancer Users >1 million+
  74. 74. Amazon RDS DB Instance Active (Multi-AZ) Availability Zone Amazon RDS DB Instance Read Replica Amazon RDS DB Instance Read Replica Web Instance Web Instance Web Instance Web Instance User Amazon S3 Amazon DynamoDB Amazon SQS ElastiCache Worker Instance Worker Instance Amazon CloudWatch Internal App Instance Internal App Instance Amazon SES AWS Lambda Amazon Route 53 Amazon CloudFront Load balancer Amazon DynamoDB Amazon API Gateway Users >1 million+
  75. 75. The next big steps
  76. 76. Database Issues? How can you solve it? • Moving some functionality to other types of DBs (NoSQL, Graph) • Federation—splitting into multiple DBs based on function • Sharding—splitting one dataset up across multiple hosts Users >5 million - 10 million
  77. 77. Database federation • Split up databases by function/purpose • Harder to do cross-function queries • Essentially delays sharding/NoSQL • Won’t help with single huge functions/tables Clientes DB Unicornios DB Products DB
  78. 78. • More complex at the application layer • No practical limit on scalability • Operation complexity/sophistication • Shard by function or key space • RDBMS or NoSQL User ShardID 002345 A 002346 B 002347 C 002348 B 002349 A CBA Sharded horizontal scaling
  79. 79. To infinity... 10+ million users!
  80. 80. • More fine-tuning of your application • More SOA/ MS of features/functionality • Going from Multi-AZ to multi-region • Possibly start to build custom solutions • Deep analysis of your entire stack • Amazon EC2 Container Service • AWS Lambda User >10 million
  81. 81. A quick review
  82. 82. • Multi-AZ your infrastructure. • Make use of self-scaling services—ALB, Amazon S3, AWS Lambda, Amazon SNS, Amazon SQS, AWS Step Functions, etc. • Build in redundancy at every level. • Start with SQL. Seriously. • Cache data both inside and outside your infrastructure. • Use automation tools in your infrastructure. A quick review
  83. 83. • Make sure you have good metrics/monitoring/logging • Split tiers into individual services (Microservices) • Use Auto Scaling once you’re ready for it • Don’t reinvent the wheel • Move to NoSQL if and when it makes sense A quick review continued
  84. 84. • READ! • aws.amazon.com/documentation • aws.amazon.com/architecture • aws.amazon.com/solutions • aws.amazon.com/quickstart • START USING AWS: • aws.amazon.com/free • CLOUD NINJA SESSION Call to Action
  85. 85. • forums.aws.amazon.com • aws.amazon.com/premiumsupport • Your Account Manager • A Solutions Architect • A Partner You’re not alone!
  86. 86. GRACIAS
  87. 87. Califica nuestra charla

×