Más contenido relacionado La actualidad más candente (20) Similar a ARC201_Scaling Up to Your First 10 Million Users (20) Más de Amazon Web Services (20) ARC201_Scaling Up to Your First 10 Million Users1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Scaling Up to Your First 10 Million
Users
B e n T h u r g o o d , P r i n c i p a l S o l u t i o n s A r c h i t e c t , P u b l i c S e c t o r
A R C 2 0 1
November 28, 2017
2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
http://i.telegraph.co.uk/multimedia/archive/02674/CLIMBER_2674482b.jpg
4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Now that’s a lot
of things to read!
This is NOT
where we
want to start!
6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
It’s not the single thing that fixes
everything.
7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What do we need first?
8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Some basics…
9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Global Infrastructure
Region, # of zones
Coming Soon!
10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Global Infrastructure
Region, # of zones
Coming Soon!
100+ Edge
Locations
11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ENTERPRISE
APPS
DEVELOPMENT & OPERATIONSMOBILE SERVICESAPP SERVICESANALYTICS
Data
Warehousing
Hadoop/
Spark
Streaming Data
Collection
Machine
Learning
Elastic
Search
Virtual
Desktops
Sharing &
Collaboration
Corporate
Email
Backup
Queuing &
Notifications
Workflow
Search
Email
Transcoding
One-click App
Deployment
Identity
Sync
Single Integrated
Console
Push
Notifications
DevOps Resource
Management
Application Lifecycle
Management
Containers
Triggers
Resource
Templates
TECHNICAL &
BUSINESS
SUPPORT
Account
Management
Support
Professional
Services
Training &
Certification
Security
& Pricing
Reports
Partner
Ecosystem
Solutions
Architects
MARKETPLACE
Business
Apps
Business
Intelligence
Databases
DevOps
Tools
NetworkingSecurity Storage
Regions
Availability
Zones
Points of
Presence
INFRASTRUCTURE
CORE SERVICES
Compute
VMs, Auto-scaling,
& Load Balancing
Storage
Object, Blocks,
Archival, Import/Export
Databases
Relational, NoSQL,
Caching, Migration
Networking
VPC, DX, DNS
CDN
Access
Control
Identity
Management
Key
Management
& Storage
Monitoring
& Logs
Assessment
and reporting
Resource &
Usage Auditing
SECURITY & COMPLIANCE
Configuration
Compliance
Web application
firewall
HYBRID
ARCHITECTURE
Data
Backups
Integrated
App
Deployments
Direct
Connect
Identity
Federation
Integrated
Resource
Management
Integrated
Networking
API
Gateway
IoT
Rules
Engine
Device
Shadows
Device
SDKs
Registry
Device
Gateway
Streaming Data
Analysis
Business
Intelligence
Mobile
Analytics
Most Robust, Fully-Featured Technology Infrastructure Platform
12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS building blocks
Inherently highly scalable, available and
fault-tolerant services
Highly scalable,
available with the right
architecture
Amazon CloudFront
Amazon Route 53
Amazon S3
Amazon DynamoDB
Elastic Load Balancing
Amazon EFS
AWS Lambda
Amazon SQS
Amazon SNS
Amazon SES
AWS Step Functions
…
Amazon EC2
Amazon EBS
Amazon RDS
Amazon VPC
13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Considerations
Rex Boggs
https://creativecomm
ons.org/licenses/by-
nd/2.0/
14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
“Many decisions are
reversible, two-way
doors.”
-- Jeff Bezos
15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Build Measure
Learn
16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
So let’s start from…
17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
You
18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1 User
Amazon
EC2
instance
Elastic IP
User
Amazon
Route 53
19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
“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
21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
“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
22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1 User
• No failover
• No redundancy
• Too many eggs in one
basket
EC2
Instance
Elastic IP
User
Amazon
Route 53
23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >1
24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users > 1
Web
Instance
Database
Instance
Elastic IP
User
Amazon
Route 53
25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Self-managed Fully managed
Amazon EC2 Amazon
DynamoDB
Amazon RDS Amazon
Redshift
Database options
26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• 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
Amazon Aurora
27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
To NoSQL, or not to NoSQL?
28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Start with SQL databases
29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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.
30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AH HA! You said
“massive
amounts”
31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
> 5 TB in year one?
Incredibly data intensive workload?
OK!
You might need NoSQL.
32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Why else might you need NoSQL?
• Super low-latency applications
• Metadata-driven datasets
• Highly nonrelational data
• Need schema-less data constructs*
• Rapid ingest of data (thousands of records/sec)
• Massive amounts of data (again, in the TB range)
*Need!= “It’s easier to do dev without schemas”
33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users > 1
Registration,
Sign In, etc
34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
GuestYour own auth
Amazon Cognito
35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >100
36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >100
Web
instance
Elastic IP
Amazon
RDS DB
instance
User
Amazon
Route 53
37. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >1000
38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >1000
Web
Instance
Amazon RDS DB Instance
Active (Multi-AZ)
Availability Zone Availability Zone
Web
Instance
Amazon RDS DB Instance
Standby (Multi-AZ)
Load
balancer
User
Amazon
Route 53
39. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load Balancers
Classic Load BalancerApplication Load Balancer Network Load Balancer
40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Application Load Balancer
• Highly available
• 1 - 65535
• Health checks
• Session stickiness
• Monitoring / logging
• Content-based routing
• Container-based apps
• WebSockets
• HTTP/2
Recommended
41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Network Load Balancer
• Layer 4
• Extreme performance
• Ultra-low latency
• Volatile workloads
• Static IP
• Elastic IP
• Preserve source IP
42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
horizontally
vertically
43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >100,000
44. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users > 10,000s–100,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
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
45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon RDS DB Instance
Active (Multi-AZ)
Availability Zone
Load
balancer
Amazon S3
Amazon
CloudFront
Amazon
Route 53
User
Shift some load around
Web Instances
Availability Zone
Web Instances
Amazon RDS DB Instance
Standby (Multi-AZ)
46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Object-based storage
• Highly durable
• Great for static assets
• “Infinitely scalable”
• Objects up to 5 TB in
size
• Encryption at rest and
in transit
Amazon Simple Storage Service (S3)
47. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Cache content for
faster delivery
• Lower load on origin
• Dynamic and static
content
• Streaming video
• Custom SSL certificates
• Low TTLs (as short as 0
seconds)
• Optimized for AWS
Amazon CloudFront
48. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon CloudFront
ResponseTime
ServerLoad
Response
Time
Server
Load
Response
Time
Server
Load
No CDN CDN for Static
Content
CDN for Static &
Dynamic Content
0
10
20
30
40
50
60
70
80
VolumeofData
Delivered(Gbps)
49. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
50. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
51. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Shift some load around
Amazon RDS DB Instance
Active (Multi-AZ)
Availability Zone
Load
balancer
Amazon S3
Amazon
CloudFront
Amazon
Route 53
User
Amazon
ElastiCache
Amazon
DynamoDB
Web Instances
52. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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!!
53. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon DynamoDB
AWS Database
Migration Service!!
• 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!!
54. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon DynamoDB Accellerator
DynamoDB
Your Applications
DynamoDB Accelerator
• Read performance and scale: Microseconds
response times at millions of reads/sec from
single DAX cluster
• Lower costs: Reduce provisioned read
capacity for DynamoDB tables for tables with
hot data
55. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Now that our web tier is
much more lightweight,
we can revisit the beginning
of our talk…
56. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Auto Scaling!
57. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Typical weekly traffic to Amazon.com
58. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Typical weekly traffic to Amazon.com
Provisioned capacity
59. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
November
November traffic to Amazon.com
60. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Provisioned capacity
November
November traffic to Amazon.com
61. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
November traffic to Amazon.com
76%
24%
November
Provisioned capacity
62. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
November traffic to Amazon.com
November
63. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Auto Scaling
lets you do this!
64. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
Auto Scaling
65. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users > 500,000+
Availability Zone
Amazon
Route 53
User
Amazon S3
Amazon
CloudFront
Availability Zone
Load
balancer
Amazon
DynamoDBAmazon RDS DB
Instance Read
Replica
Web
Instance
Web
Instance
Web
Instance
Amazon
ElastiCache
Amazon RDS DB
Instance Read
Replica
Web
Instance
Web
Instance
Web
Instance
Amazon
ElastiCache
Amazon RDS DB
Instance Standby
(Multi-AZ)
Amazon RDS DB
Instance
Active (Multi-AZ)
66. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users > 500,000+
Availability Zone
Amazon
Route 53
User
Amazon S3
Amazon
CloudFront
Availability Zone
Load
balancer
Amazon
DynamoDBAmazon RDS DB
Instance Read
Replica
Web
Instance
Web
Instance
Web
Instance
Amazon
ElastiCache
Amazon RDS DB
Instance Read
Replica
Web
Instance
Web
Instance
Web
Instance
Amazon
ElastiCache
Amazon RDS DB
Instance Standby
(Multi-AZ)
Amazon RDS DB
Instance
Active (Multi-AZ)
67. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Use automation
68. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS application management solutions
Convenience Control
Higher-level services Do it yourself
AWS
Elastic Beanstalk
AWS
OpsWorks
AWS
CloudFormation
Amazon EC2
69. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Services
Source Build Test Production
Third Party
Tooling
Software Release Steps:
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodePipeline
70. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodeStar
• Start developing on AWS in
minutes
• Work across your team, securely
• Manage software delivery easily
• Choose from a variety of project
templates
Quickly develop, build, and deploy applications on AWS
71. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
72. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AGGREGATE
LEVEL
METRICS
LOG
ANALYSIS
EXTERNAL
SITE
PERFORMANCE
HOST
LEVEL
METRICS
73. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudWatch percentiles
74. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
There are further
improvements to be made in
breaking apart our
web/app layer
75. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Monolithic Architecture
User Interface
Business Logic
Data Access
76. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SOA
What does this mean?
77. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
78. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Now that’s a lot
of things to read!
This is NOT
where we
want to start!
79. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
This is NOT
where we
want to start!
This IS where
we want to start!
Now that’s a lot
of things to read!
80. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Service-Oriented Architecture
Presentation Tier Logic Tier
Data Tier
81. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SOAing
Move services into their own tiers
• Treat them separately
• Scale them independently
It offers flexibility and greater
understanding of each component
82. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Loose coupling + Serverless = winning
DON’T REINVENT THE WHEEL
• Email
• Queuing
• Transcoding
• Search
• Databases
• Monitoring
• Metrics
• Logging
• Compute
Amazon SQSAmazon SNS
Amazon Elastic
Transcoder
AWS Step
Functions
Amazon SESAWS Lambda
Amazon Elastic
Search
Amazon API
Gateway
83. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Reliable (Multi-AZ)
• Scalable (unlimited messages)
• Secure (queue authentication)
• Simple (simple APIs)
Application Services – Amazon SQS
Amazon
SQS
messages
Get
message
Instance
Put
message
Instance
Amazon SNS Topic
Publish
notification
Queue is subscribed
to topic
84. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Event Driven Compute – AWS Lambda
• Functions triggered by events
• Node.js (JavaScript), Java,
Python, and C#
• Managed
• Implicit scaling S3 bucket
Lambda
Push: event
notification
DynamoDB
Pull: DynamoDB
Stream
Amazon
Kinesis
Pull:
Amazon Kinesis
stream
85. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Loose coupling sets you free!
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
86. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless Web application
Data stored in
Amazon
DynamoDB
Dynamic content
in AWS Lambda
Amazon API
Gateway
Browser
Amazon
CloudFront
Amazon
S3
87. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
88. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Microservices Architecture
89. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservices
90. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS X-Ray
• 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
91. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Visualize service call graph
92. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Trace
93. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >1,000,000
94. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >1 million+
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
• Service oriented architecture (SOA)
• Serving content smartly (Amazon S3/CloudFront)
• Caching off DB
• Moving state off tiers that auto scale
95. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >1 million+
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
96. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >1 million+
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
97. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The next big steps
98. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Users >5 million - 10 million
Database Issues?
How can you solve it?
• Federation—splitting into multiple DBs based on function
• Sharding—splitting one dataset up across multiple hosts
• Moving some functionality to other types of DBs (NoSQL, Graph)
99. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
Forums DB
Users DB
Products
DB
100. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Sharded horizontal scaling
• 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
101. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Shifting functionality to NoSQL
• Similar in a sense to federation
• NoSQL vs. SQL
• Leverage managed services like
DynamoDB
Some use cases:
• Leaderboards/scoring
• Rapid ingest of clickstream/log data
• Temporary data needs (cart data)
• “Hot” tables
• Metadata/lookup tables
DynamoDB
102. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A quick review
103. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A quick review
• 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.
104. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A quick review continued
• Make sure you have good metrics/monitoring/logging
• Split tiers into individual services (SOA)
• Use Auto Scaling once you’re ready for it
• Don’t reinvent the wheel
• Move to NoSQL if and when it makes sense
105. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
10+ million users!
106. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
To infinity...
107. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
User >10 million
• More fine-tuning of your application
• More SOA 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
108. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Next steps?
READ!
aws.amazon.com/documentation
aws.amazon.com/architecture
aws.amazon.com/solutions
aws.amazon.com/quickstart
START USING AWS:
aws.amazon.com/free
109. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
You’re not alone!
forums.aws.amazon.com
aws.amazon.com/premiumsupport
Your Account Manager
A Solutions Architect
110. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
B e n T h u r g o o d
A R C 2 0 1 : S c a l i n g U p t o Y o u r F i r s t 1 0 M i l l i o n U s e r s