Mais conteúdo relacionado Semelhante a Come scalare da zero ai tuoi primi 10 milioni di utenti.pdf (20) Mais de Amazon Web Services (20) Come scalare da zero ai tuoi primi 10 milioni di utenti.pdf1. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Giorgio Bonfiglio
(bonfigg@amazon.com)
Technical Account Manager - Enterprise Support - AWS
Paolo Baire - Marco Careddu
ShopFully Group
Scaling From Zero to Your
First 10 Million Users
2. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
3. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
4. © 2018, 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!
5. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
It’s not the single thing that
fixes everything.
6. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
What do we need first?
7. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Some basics…
8. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS Global Infrastructure
Region (# of Zones)
Coming Soon!
9. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS Global Infrastructure
Region (# of Zones)
Coming Soon!
100+ Edge
Locations
10. © 2018, 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 &
Notification
s
Workflo
w
Search
Email
Transcoding
One-click App
Deployment
Identity
Sync
Single Integrated
Console
Push
Notification
s
DevOps Resource
Management
Application
Lifecycle
Management
Containers
Triggers
Resource
Templates
TECHNICAL &
BUSINESS
SUPPORT
Account
Management
Support
Professional
Services
Training &
Certificatio
n
Security
& Pricing
Reports
Partner
Ecosystem
Solutions
Architects
MARKETPLACE
Business
Apps
Business
Intelligenc
e
Databases
DevOps
Tools
Networkin
g
Securit
y
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
Networkin
g
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
11. © 2018, 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
12. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Considerations
Rex Boggs
https://creativecommons.org/licenses/by-nd/2.0/
13. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
“Many decisions are
reversible, two-way
doors.”
-- Jeff Bezos
14. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Build Measure
Learn
15. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
So let’s start from…
16. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
You
17. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
1 User
Amazon
EC2
instance
Elastic IP
User
Amazon
Route 53
18. © 2018, 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
19. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
“We’re gonna need a bigger box”
• Simplest approach
• 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
20. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
“We’re gonna need a bigger box”
• Simplest approach
• 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. © 2018, 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
22. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >1
23. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users > 1
Web
Instance
Database
Instance
Elastic IP
User
Amazon
Route 53
24. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Self-managed Fully managed
Amazon EC2 Amazon
DynamoDB
Amazon RDS Amazon
Redshift
Database options
25. © 2018, 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
26. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
To NoSQL, or not to NoSQL?
27. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Start with SQL databases
28. © 2018, 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 scalability patterns
*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.
29. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AH HA! You said
“massive
amounts”
30. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
> 5 TB in year one?
Incredibly data intensive workload?
OK!
You might need NoSQL.
31. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Why else might you need NoSQL?
• Super low-latency applications
• Metadata-driven datasets
• Highly non-relational data
• Need schema-less data constructs*
• Rapid ingest of data (thousands of records/sec)
• Massive amounts of data (in the TB range)
*Need != “It’s easier to do dev without schemas”
32. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users > 1
Registration,
Sign In, etc
33. © 2018, 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
34. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >100
35. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >100
Web
instance
Elastic IP
Amazon
RDS DB
instance
User
Amazon
Route 53
36. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >1000
37. © 2018, 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
38. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Load Balancers
Classic Load BalancerApplication Load Balancer Network Load Balancer
39. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Application Load Balancer
• Highly available
• Health checks
• Session stickiness
• Monitoring / logging
• Content-based routing
• Container-based apps
• WebSockets
• HTTP/2
Recommended
40. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Network Load Balancer
• Layer 4
• Elastic / Static IP
• Preserve source
• Extreme performance
• Ultra-low latency
• Volatile workloads
41. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
horizontally
vertically
42. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >100,000
43. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >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
44. © 2018, 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)
45. © 2018, 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)
46. © 2018, 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)
Amazon CloudFront
47. © 2018, 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)
48. © 2018, 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
49. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Amazon ElastiCache
• Managed Memcached or Redis
• Scale from one to many nodes
• Self-healing
• Single digit ms speeds
• Multi-AZ possible with Redis
50. © 2018, 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
51. © 2018, 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
• Can scale automatically!
52. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Amazon DynamoDB Accelerator
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
53. © 2018, 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…
54. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Auto Scaling!
55. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Typical weekly traffic to Amazon.com
56. © 2018, 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
57. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
November
November traffic to Amazon.com
58. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Provisioned capacity
November
November traffic to Amazon.com
59. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
November traffic to Amazon.com
76%
24%
November
Provisioned capacity
60. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
November traffic to Amazon.com
November
61. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Auto Scaling
lets you do this!
62. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Automatic resizing of instance fleets
Define min/max pool sizes
CloudWatch metrics drive scaling
On-Demand and/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 eu-west-2a, eu-west-2b
Auto Scaling
63. © 2018, 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)
64. © 2018, 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)
65. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Use automation
66. © 2018, 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
67. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >500,000+
• Monitoring, metrics, and logging
• What are customers saying?
• Try to squeeze as much performance
out of each service/component
68. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AGGREGATE
LEVEL
METRICS
LOG
ANALYSIS
EXTERNAL
SITE PERFORMANCE
HOST
LEVEL
METRICS
69. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
CloudWatch percentiles
70. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
There are further
improvements to be made in
breaking apart our
web/app layer
71. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
The Monolithic Architecture
User Interface
Business Logic
Data Access
72. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
SOA
What does this mean?
73. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
The Service-Oriented Architecture
Presentation Tier Logic Tier
Data Tier
74. © 2018, 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
75. © 2018, 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 FunctionsAmazon SESAWS Lambda
Amazon Elastic
Search
Amazon API
Gateway
76. © 2018, 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
77. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Event Driven Compute – AWS Lambda
• Functions triggered by events
• Node.js, Java, Python, and C#
• Managed
• Implicit scaling
S3 bucket
Lambda
Push: event
notification
DynamoDB
Pull: DynamoDB
Stream
Amazon
Kinesis
Pull:
Amazon Kinesis
stream
78. © 2018, 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
79. © 2018, 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
80. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
The Microservices Architecture
81. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Microservices in AWS
82. © 2018, 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
83. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Visualize service call graph
84. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >1,000,000
85. © 2018, 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
86. © 2018, 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
87. © 2018, 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
88. Paolo Baire - Chief Architect
Marco Careddu - Web Architect
AWS Native WebApp
92. Where we are
Just migrated to AWS
from old legacy datacenter
PHP with LAMP stack
Migrated to ElasticBeanstalk
Scaling rely on AWS EC2 Autoscale
93. The Challenge
Marketing team needs to reach
millions of users that comes
from different networks
Feel like a natural app on the device,
with an immersive user experience.
No way to predict when
users comes to our network
94. The Challenge
EC2 Autoscale is fantastic option
but isn’t the best for huge spikes
When a spike arrive, ELB
start
cut connections and wild
503 appears
We’re present in countries
With poor internet connection
95. The Challenge
Request Count Up to 1000%
Response Time Increase
503!
0
750
1500
2250
3000
Latency (ms) 503
0
22500
45000
67500
90000
Requests
96. The Solution
WHERE WE ARE
Migrated our Services to AWS
Full adopting AWS Technology
REQUIREMENTS
We want continue to use AWS services
And move focus on ServerLess Approach
Continuous Integration
Infrastructure design
Spike resilient Infrastructure
Always have a fast response time
MVP features
97. The Solution
React web application
Hosted in a S3 bucket configured as website
CloudFront Entrypoint
CloudFront combined with proper cache offloads S3 origin
Continuous Integration
Configured with Code Pipeline
98. The Solution
1 Git Repository
2 CI with Code Pipeline
3 Host WebApp with S3
4 Served with CloudFront
99. A real example: a spike we had on 2nd March
0
22500
45000
67500
90000 Requests
100. A real example: a spike we had on 2nd March
0
30
60
90
120
150
Latency (ms) 503
101. Next Steps
Serverless Isolation
Continue the Serverless Approach to migrate other
platform features to React App
S3 Multi Zone Replication
Enable multi zone replication for reduce latency between
some “far away” POP and become reslient to region down
CloudWatch Alarm Improve
Improve (even more) our alarm management by extending
the use of CloudWatch to quickly report spikes and
affected users (if any)
103. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
The next big steps
104. © 2018, 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)
105. © 2018, 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
106. © 2018, 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
107. © 2018, 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
108. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
A quick review
109. © 2018, 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
110. © 2018, 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
111. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
10+ million users!
112. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
To infinity...
113. © 2018, 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
114. © 2018, 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
115. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
You’re not alone!
forums.aws.amazon.com
aws.amazon.com/premiumsupport
Your (Technical) Account Manager
A Solutions Architect
116. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Thank You!