SlideShare a Scribd company logo
1 of 100
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adrian Hornsby
Cloud Architecture Evangelist – Amazon Web Services
Scaling up to and beyond 10M
users
@adhorn
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 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!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What are we scaling?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
horizontally
vertically
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
People
Application
Network & Data
Infrastructure
Scalabilty 101
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Fundamentals
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Region and Availability Zones
Availability Zone a
Availability Zone bAvailability Zone c
Region
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Region (# of Zones)
Coming Soon!
AWS Global Infrastructure
55 Availability Zones within 18 geographic Region
+ 116 Points of Presence
(105 Edge Locations and 11
Regional Edge Caches)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Let’s start from…
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The “Must” from Day 1
• High quality code
• Version controlled
• Automation when possible
• Infrastructure as code
• CI/CD pipeline
• Security at every layer
• Cost conscious
• Test everything
• DR procedure
Operational Excellence
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build Measure
Learn
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Users > 1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Start simple, basic
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Simple Storage Service (S3)
Amazon S3
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon S3
App v0.1
Simple Static Website
http://poliko.adhorn.me.s3-website-us-east-1.amazonaws.com/
Bucket name: poliko.adhorn.me
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Route53
• Traffic Policies
• Latency Based Routing
• Geo DNS
• Weighted Round Robin
• DNS Failover
• Private DNS for Amazon VPC
• Health Checks and Monitoring
• Domain Registration
Highly available and scalable DNS web service.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon S3
App v0.2
http://poliko.adhorn.me.s3-website-us-east-1.amazonaws.com/
Simple Static Website
Amazon
Route53 http://poliko.adhorn.me
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Custom backend
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
App v1a
Amazon
EC2
instance
Elastic IP
User
Amazon
Route 53
EC2 backend
www.example.com
54.223.92.16
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
App v1b
Docker
Container
Elastic IP
User
Amazon
Route 53
Containerized backend
www.example.com
54.223.92.16
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Managed
API Gateway
cache
Amazon
CloudWatch
API Gateway
Endpoints on
Amazon EC2
Any other publicly
accessible endpoint
AWS Lambda
functions
Amazon
CloudFront
API Gateway
User Amazon
Route 53
App v1c
Serverless backend
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Application
Elastic IP
Database
User
Amazon
Route 53
App v2.0
Adding the database www.example.com
54.223.92.16
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Self-managed Fully managed
Amazon EC2 Amazon
DynamoDB
Amazon RDS
Database options
SQL vs NoSQL
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
User Sign-Up, Sign-In
Access Control
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
User Sign-Up, Sign-In, and Access Control
Amazon Cognito
Secure and scalable user
directory
Social and enterprise
identity federation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Application
Elastic IP
Database
User
Amazon
Route 53
App v2.1
with Authentication www.example.com
54.223.92.16
Amazon
Cognito
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Users > 1000
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Separation of content type
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Content Delivery Network
Amazon CloudFront
• Cache content at the edge
• Lower load on origin
• Dynamic and static content
• Streaming video
• Custom SSL certificates
• Low TTLs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Application
Elastic IP
Database
User
Amazon
Route 53
App v3.0
Separate static assets from dynamic content
Amazon S3
Amazon
CloudFront
*.js
*.jpeg
*.mp4
Amazon
Cognito
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Availability and Redundancy
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Availability in Parallel
Component Availability Downtime
X 99% (2-nines) 3 days 15 hours
Two X in parallel 99.99% (4-nines) 52 minutes
Three X in parallel 99.9999% (6-nines) 31 seconds
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Availability Zone 1 Availability Zone 2 Availability Zone n
Multi-AZ
Support Instance Failure
Application
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Highly available
• Health checks
• Session stickiness
• Monitoring / logging
• Content-based routing
• Container-based apps
• WebSockets
• HTTP/2
Elastic Load Balancer
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Web
Instance
RDS DB Instance
Active (Multi-AZ)
Availability Zone Availability Zone
Web
Instance
RDS DB Instance
Standby (Multi-AZ)
Load
balancer
App v4.0
Available & redundant application
User
Amazon
Route 53
Amazon
CloudFront
Amazon S3
Amazon
Cognito
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
App v4.0
Serverless option (be aware of limitations)
Amazon
DynamoDB
AWS LambdaAmazon API
Gateway
Browser
Amazon
CloudFront
Amazon
S3
Amazon
Cognito
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Caching layer
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon
ElastiCache
RDS DB Instance
Active (Multi-AZ)
Availability Zone Availability Zone
RDS DB Instance
Standby (Multi-AZ)
ELB
User
Amazon
Route 53
Amazon
CloudFront
Amazon S3
App v5.0
Stateless application
Web
Instance
Web
Instance
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Elasticache
Redis and Memcached
• Transient session data
• Shared state
• High-frequency counters
• Queues
• Leaderboards
• Lists, sets, …
In-memory data store and cache
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Microseconds response times at
millions of reads/sec from single DAX
cluster
• Reduce provisioned read capacity for
DynamoDB tables for tables with hot
data
Amazon DynamoDB Accelerator (DAX)
Read- and Write-Through
Application
DAX
DynamoDB
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Users > 100,000
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Typical weekly traffic to Amazon.com
© 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
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
November
November traffic to Amazon.com
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
November
November traffic to Amazon.com
Provisioned capacity
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
November
November traffic to Amazon.com
Provisioned capacity
76%
24%
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Auto-Scaling • Compute efficiency
• Node failure
• Traffic spikes
• Performance bugs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
November
November traffic to Amazon.com
with auto-scaling
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RDS DB Instance
Active (Multi-AZ)
Availability Zone Availability Zone
RDS DB Instance
Standby (Multi-AZ)
ELB
App v6.0
Auto scaling groups
User
Amazon
Route 53
Amazon
CloudFront
Amazon S3
Web
Instances
Web
Instances ElastiCache
Auto-Scaling group
STATELESS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Users > 1,000,000
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Databases
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Read / Write Sharding
RDS DB Instance
Read Replica
App
Instance
App
Instance
App
Instance
RDS DB Instance
Master (Multi-AZ)
RDS DB Instance
Read Replica
RDS DB Instance
Read Replica
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Database Federation
Users
DB
Products
DB
App
Instance
App
Instance
App
Instance
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Database Sharding
User ShardID
002345 A
002346 B
002347 C
002348 B
002349 A
CBA
App
Instance
App
Instance
App
Instance
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Transient state does not belong
in the database
BUT is perfect in the cache!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Little story of Databases at Amazon
“A deep dive on how we were using our existing databases
revealed that they were frequently not used for their
relational capabilities. About 70 percent of operations were
of the key-value kind, where only a primary key was used
and a single row would be returned. About 20 percent would
return a set of rows, but still operate on only a single table.”
Werner Vogels
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Prime Day 2017 Metrics
Block Storage – Use of Amazon Elastic Block Store (EBS) grew by 40% year-over-year, with aggregate
data transfer jumping to 52 petabytes (a 50% increase) for the day and total I/O requests rising to 835
million (a 30% increase).
NoSQL Database – Amazon DynamoDB requests from Alexa, the Amazon.com sites, and the Amazon
fulfillment centers totaled 3.34 trillion, peaking at 12.9 million per second.
Stack Creation – Nearly 31,000 AWS CloudFormation stacks were created for Prime Day in order to
bring additional AWS resources on line.
API Usage – AWS CloudTrail processed over 50 billion events and tracked more than 419 billion, all in
support of Prime Day.
Configuration Tracking – AWS Config generated over 14 million Configuration items for AWS
resources.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Users > 10,000,000
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Asynchronous patterns
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CAP Theorem
Consistency Availability Partition Tolerance
Data is consistent.
All nodes see the same state.
Every request is non-failing. Service still responds as expected
if some nodes crash.
Distributed System
In the presence of a network partition, you must
choose between consistency and availability!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Eventual Consistency
… if no new updates are
made to a given data item,
eventually all accesses to that
item will return the last
updated value.
Availability
An eventually consistent system can
return any value before it converges!!
https://en.wikipedia.org/wiki/Eventual_consistency
Distributed System
Every request is non-failing.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Process A Process B Process A Process B
Synchronous Asynchronous
Waiting
Working
Continues
get or fetch resultGet result
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Non-blocking UI
https://medium.com/@sophie_paxtonUX/stop-getting-in-my-way-non-blocking-ux-5cbbfe0f0158
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Message passing for async. patterns
A
Queue
B
A
Queue
BListener
Pub-Sub
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Web
Instances
Worker
Instance
Worker
Instance
Queue
API
Instance
API
Instance
API
Instance
API: {DO foo}
PUT JOB: {JobID: 0001, Task: DO foo}
API: {JobID: 0001}
GET JOB: {JobID: 0001, Task: DO foo}
Cache
Result:
{
JobID: 0001,
Result: bar
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Worker
Instance
Worker
Instance
Queue
API
Instance
API
Instance
API
Instance
Cache
Amazon SNS
Push Notification
User
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RDS DB Instance
Active (Multi-AZ)
Availability Zone
Elastic Load
Balancer
Web
Instance
Web
Instance
Amazon
Route 53User
Amazon S3
Amazon
Cloudfront
ElastiCache
Worker
Instance
Worker
Instance
App v7.0
Full Decoupling
Queue Amazon SNS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The Microservices Architecture
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event-driven patterns to the rescue
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How Lambda works
S3 event
notifications
DynamoDB
Streams
Kinesis
events
Cognito
events
SNS
events
Custom
events
CloudTrail
events
LambdaDynamoDB
Kinesis S3
Any custom
Invoked in response to events
- Changes in data
- Changes in state
Redshift
SNS
Access any service,
including your own
Such as…
Lambda functions
CloudWatch
events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event-driven using Lambda and S3
AWS Lambda:
Resize Images
Users upload photos
S3:
Source Bucket
S3:
Destination Bucket
Triggered on
PUTs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event-driven using Lambda and DynamoDB
Amazon
DynamoDB
AWS
Lambda
Amazon
DynamoDB Streams
Actions
Item Create
Item Update
Item Delete
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Monitoring & Steady State
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Monitoring, metrics, and logging
• What are customers saying?
• Try to squeeze as much performance
out of each service/component
Make it ridiculously easy to start monitoring a new metric!
1 line of code rule
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AGGREGATE
LEVEL
METRICS
LOG
ANALYSIS
EXTERNAL
SITE PERFORMANCE
HOST
LEVEL
METRICS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Steady State
• ”normal” behavior of your system
https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero
Steady State
• ”normal” behavior of your system
• Business Metric
https://medium.com/netflix-techblog/sps-the-pulse-of-netflix-streaming-ae4db0e05f8a
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Increasing Resiliency
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Circuit Breaker
• Wrap a protected function call in a
circuit breaker object, which
monitors for failures.
• If failures reach a certain
threshold, the circuit breaker trips.
https://martinfowler.com/bliki/CircuitBreaker.html
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Service Degradation & Fallbacks
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Save yourself a rollback ..
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Immutable Infrastructure
No updates on live systems
• Always start from a new resource being provisioned
• Deploy the new software
• Test in different environments (dev, staging)
• Deploy to prod (inactive)
• Change references (DNS or Load Balancer)
• Keep old version around (inactive)
• Fast rollback if things go wrong
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New Version
Users
Canary deployment for Immutable Infra.
Old Version
99%
Users
1%
Users
Start with ..
Dynamic Routing
(Route53)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Time to Go Global!
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
James Hamilton – 2016 re:Invent
Vice President & Distinguished Engineer
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Multi-Region Multi-VPC Connectivity
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
S3 - Cross-Region Replication
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cross-Region Read Replicas for Amazon RDS
** For Aurora, MySQL,
MariaDB and PostgreSQL
engines.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cross-Region Usage Pattern
• Regional Reads
• All critical writes traffic
to a single master
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora multi-master - scale out reads & writes
First MySQL compatible DB service with scale-out across multiple data centers
Zero application downtime from ANY instance failure
Zero application downtime from ANY AZ failure
Faster write performance and higher scale
Sign up for single-region multi-master preview today;
Multi-Region Multi-Master coming in 2018
Availability
Zone 1
Scale out both reads and writes
Availability
Zone 2
Availability
Zone 3
Application
Read/Write
Master 1
Shared distributed storage volume
Read/Write
Master 2
Read/Write
Master 3
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon DynamoDB Global Tables (GA)
First fully managed, multi-master, multi-region database
Build high performance, globally distributed applications
Low latency reads & writes to locally available tables
Disaster proof with multi-region redundancy
Easy to set up and no application rewrites required
Globally dispersed users
Replica (N. America)
Replica (Europe)
Replica (Asia)
Global App
Global Table
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon
DynamoDB
AWS LambdaAmazon API
Gateway
Amazon
DynamoDB
AWS LambdaAmazon API
Gateway
Amazon
Route53
eu-west-1
us-east-1
GlobalTables
https://globalddb.adhorn.me/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Users beyond 10,000,000
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
… at the Edge
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fire Drills
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Testing to the next level: Failure Injection
• Start small & build confidence
• Application level
• Host failure
• Resource attacks (CPU, memory, …)
• Network attacks (dependencies, latency, …)
• Region attacks!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Chaos Engineering
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
@adhorn
https://medium.com/@adhorn

More Related Content

More from Adrian Hornsby

Moving Forward with AI
Moving Forward with AIMoving Forward with AI
Moving Forward with AIAdrian Hornsby
 
AI: State of the Union
AI: State of the UnionAI: State of the Union
AI: State of the UnionAdrian Hornsby
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural PatternsAdrian Hornsby
 
re:Invent re:Cap - An overview of Artificial Intelligence and Machine Learnin...
re:Invent re:Cap - An overview of Artificial Intelligence and Machine Learnin...re:Invent re:Cap - An overview of Artificial Intelligence and Machine Learnin...
re:Invent re:Cap - An overview of Artificial Intelligence and Machine Learnin...Adrian Hornsby
 
re:Invent re:Cap - Big Data & IoT at Any Scale
re:Invent re:Cap - Big Data & IoT at Any Scalere:Invent re:Cap - Big Data & IoT at Any Scale
re:Invent re:Cap - Big Data & IoT at Any ScaleAdrian Hornsby
 
Innovations and the Cloud
Innovations and the CloudInnovations and the Cloud
Innovations and the CloudAdrian Hornsby
 
Serverless in Action on AWS
Serverless in Action on AWSServerless in Action on AWS
Serverless in Action on AWSAdrian Hornsby
 
Innovations and The Cloud
Innovations and The CloudInnovations and The Cloud
Innovations and The CloudAdrian Hornsby
 
Devoxx: Building AI-powered applications on AWS
Devoxx: Building AI-powered applications on AWSDevoxx: Building AI-powered applications on AWS
Devoxx: Building AI-powered applications on AWSAdrian Hornsby
 
10 Lessons from 10 Years of AWS
10 Lessons from 10 Years of AWS10 Lessons from 10 Years of AWS
10 Lessons from 10 Years of AWSAdrian Hornsby
 
Developing Sophisticated Serverless Applications with AI
Developing Sophisticated Serverless Applications with AIDeveloping Sophisticated Serverless Applications with AI
Developing Sophisticated Serverless Applications with AIAdrian Hornsby
 
AWS Startup Day Bangalore: Being Well-Architected in the Cloud
AWS Startup Day Bangalore: Being Well-Architected in the CloudAWS Startup Day Bangalore: Being Well-Architected in the Cloud
AWS Startup Day Bangalore: Being Well-Architected in the CloudAdrian Hornsby
 
Journey Towards Scaling Your API to 10 Million Users
Journey Towards Scaling Your API to 10 Million UsersJourney Towards Scaling Your API to 10 Million Users
Journey Towards Scaling Your API to 10 Million UsersAdrian Hornsby
 
AWSome Day - Opening Keynote
AWSome Day - Opening KeynoteAWSome Day - Opening Keynote
AWSome Day - Opening KeynoteAdrian Hornsby
 
Building AI-powered Serverless Applications on AWS
Building AI-powered Serverless Applications on AWSBuilding AI-powered Serverless Applications on AWS
Building AI-powered Serverless Applications on AWSAdrian Hornsby
 
Innovations fueled by IoT and the Cloud
Innovations fueled by IoT and the CloudInnovations fueled by IoT and the Cloud
Innovations fueled by IoT and the CloudAdrian Hornsby
 
AWS Batch: Simplifying batch computing in the cloud
AWS Batch: Simplifying batch computing in the cloudAWS Batch: Simplifying batch computing in the cloud
AWS Batch: Simplifying batch computing in the cloudAdrian Hornsby
 
Being Well Architected in the Cloud (Updated)
Being Well Architected in the Cloud (Updated)Being Well Architected in the Cloud (Updated)
Being Well Architected in the Cloud (Updated)Adrian Hornsby
 
Deep Dive on Object Storage: Amazon S3 and Amazon Glacier
Deep Dive on Object Storage: Amazon S3 and Amazon GlacierDeep Dive on Object Storage: Amazon S3 and Amazon Glacier
Deep Dive on Object Storage: Amazon S3 and Amazon GlacierAdrian Hornsby
 
Serverless Streaming Data Processing using Amazon Kinesis Analytics
Serverless Streaming Data Processing using Amazon Kinesis AnalyticsServerless Streaming Data Processing using Amazon Kinesis Analytics
Serverless Streaming Data Processing using Amazon Kinesis AnalyticsAdrian Hornsby
 

More from Adrian Hornsby (20)

Moving Forward with AI
Moving Forward with AIMoving Forward with AI
Moving Forward with AI
 
AI: State of the Union
AI: State of the UnionAI: State of the Union
AI: State of the Union
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
 
re:Invent re:Cap - An overview of Artificial Intelligence and Machine Learnin...
re:Invent re:Cap - An overview of Artificial Intelligence and Machine Learnin...re:Invent re:Cap - An overview of Artificial Intelligence and Machine Learnin...
re:Invent re:Cap - An overview of Artificial Intelligence and Machine Learnin...
 
re:Invent re:Cap - Big Data & IoT at Any Scale
re:Invent re:Cap - Big Data & IoT at Any Scalere:Invent re:Cap - Big Data & IoT at Any Scale
re:Invent re:Cap - Big Data & IoT at Any Scale
 
Innovations and the Cloud
Innovations and the CloudInnovations and the Cloud
Innovations and the Cloud
 
Serverless in Action on AWS
Serverless in Action on AWSServerless in Action on AWS
Serverless in Action on AWS
 
Innovations and The Cloud
Innovations and The CloudInnovations and The Cloud
Innovations and The Cloud
 
Devoxx: Building AI-powered applications on AWS
Devoxx: Building AI-powered applications on AWSDevoxx: Building AI-powered applications on AWS
Devoxx: Building AI-powered applications on AWS
 
10 Lessons from 10 Years of AWS
10 Lessons from 10 Years of AWS10 Lessons from 10 Years of AWS
10 Lessons from 10 Years of AWS
 
Developing Sophisticated Serverless Applications with AI
Developing Sophisticated Serverless Applications with AIDeveloping Sophisticated Serverless Applications with AI
Developing Sophisticated Serverless Applications with AI
 
AWS Startup Day Bangalore: Being Well-Architected in the Cloud
AWS Startup Day Bangalore: Being Well-Architected in the CloudAWS Startup Day Bangalore: Being Well-Architected in the Cloud
AWS Startup Day Bangalore: Being Well-Architected in the Cloud
 
Journey Towards Scaling Your API to 10 Million Users
Journey Towards Scaling Your API to 10 Million UsersJourney Towards Scaling Your API to 10 Million Users
Journey Towards Scaling Your API to 10 Million Users
 
AWSome Day - Opening Keynote
AWSome Day - Opening KeynoteAWSome Day - Opening Keynote
AWSome Day - Opening Keynote
 
Building AI-powered Serverless Applications on AWS
Building AI-powered Serverless Applications on AWSBuilding AI-powered Serverless Applications on AWS
Building AI-powered Serverless Applications on AWS
 
Innovations fueled by IoT and the Cloud
Innovations fueled by IoT and the CloudInnovations fueled by IoT and the Cloud
Innovations fueled by IoT and the Cloud
 
AWS Batch: Simplifying batch computing in the cloud
AWS Batch: Simplifying batch computing in the cloudAWS Batch: Simplifying batch computing in the cloud
AWS Batch: Simplifying batch computing in the cloud
 
Being Well Architected in the Cloud (Updated)
Being Well Architected in the Cloud (Updated)Being Well Architected in the Cloud (Updated)
Being Well Architected in the Cloud (Updated)
 
Deep Dive on Object Storage: Amazon S3 and Amazon Glacier
Deep Dive on Object Storage: Amazon S3 and Amazon GlacierDeep Dive on Object Storage: Amazon S3 and Amazon Glacier
Deep Dive on Object Storage: Amazon S3 and Amazon Glacier
 
Serverless Streaming Data Processing using Amazon Kinesis Analytics
Serverless Streaming Data Processing using Amazon Kinesis AnalyticsServerless Streaming Data Processing using Amazon Kinesis Analytics
Serverless Streaming Data Processing using Amazon Kinesis Analytics
 

Recently uploaded

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Scaling up to and beyond 10M users

  • 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adrian Hornsby Cloud Architecture Evangelist – Amazon Web Services Scaling up to and beyond 10M users @adhorn
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 3. © 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!
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What are we scaling?
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. horizontally vertically
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. People Application Network & Data Infrastructure Scalabilty 101
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Fundamentals
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Region and Availability Zones Availability Zone a Availability Zone bAvailability Zone c Region
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Region (# of Zones) Coming Soon! AWS Global Infrastructure 55 Availability Zones within 18 geographic Region + 116 Points of Presence (105 Edge Locations and 11 Regional Edge Caches)
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Let’s start from…
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The “Must” from Day 1 • High quality code • Version controlled • Automation when possible • Infrastructure as code • CI/CD pipeline • Security at every layer • Cost conscious • Test everything • DR procedure Operational Excellence
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Build Measure Learn
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Users > 1
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Start simple, basic
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Simple Storage Service (S3) Amazon S3
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon S3 App v0.1 Simple Static Website http://poliko.adhorn.me.s3-website-us-east-1.amazonaws.com/ Bucket name: poliko.adhorn.me
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Route53 • Traffic Policies • Latency Based Routing • Geo DNS • Weighted Round Robin • DNS Failover • Private DNS for Amazon VPC • Health Checks and Monitoring • Domain Registration Highly available and scalable DNS web service.
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon S3 App v0.2 http://poliko.adhorn.me.s3-website-us-east-1.amazonaws.com/ Simple Static Website Amazon Route53 http://poliko.adhorn.me
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Custom backend
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. App v1a Amazon EC2 instance Elastic IP User Amazon Route 53 EC2 backend www.example.com 54.223.92.16
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. App v1b Docker Container Elastic IP User Amazon Route 53 Containerized backend www.example.com 54.223.92.16
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Managed API Gateway cache Amazon CloudWatch API Gateway Endpoints on Amazon EC2 Any other publicly accessible endpoint AWS Lambda functions Amazon CloudFront API Gateway User Amazon Route 53 App v1c Serverless backend
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Application Elastic IP Database User Amazon Route 53 App v2.0 Adding the database www.example.com 54.223.92.16
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Self-managed Fully managed Amazon EC2 Amazon DynamoDB Amazon RDS Database options SQL vs NoSQL
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. User Sign-Up, Sign-In Access Control
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. User Sign-Up, Sign-In, and Access Control Amazon Cognito Secure and scalable user directory Social and enterprise identity federation
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Application Elastic IP Database User Amazon Route 53 App v2.1 with Authentication www.example.com 54.223.92.16 Amazon Cognito
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Users > 1000
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Separation of content type
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Content Delivery Network Amazon CloudFront • Cache content at the edge • Lower load on origin • Dynamic and static content • Streaming video • Custom SSL certificates • Low TTLs
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Application Elastic IP Database User Amazon Route 53 App v3.0 Separate static assets from dynamic content Amazon S3 Amazon CloudFront *.js *.jpeg *.mp4 Amazon Cognito
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Availability and Redundancy
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Availability in Parallel Component Availability Downtime X 99% (2-nines) 3 days 15 hours Two X in parallel 99.99% (4-nines) 52 minutes Three X in parallel 99.9999% (6-nines) 31 seconds
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Availability Zone 1 Availability Zone 2 Availability Zone n Multi-AZ Support Instance Failure Application
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Highly available • Health checks • Session stickiness • Monitoring / logging • Content-based routing • Container-based apps • WebSockets • HTTP/2 Elastic Load Balancer
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Web Instance RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone Web Instance RDS DB Instance Standby (Multi-AZ) Load balancer App v4.0 Available & redundant application User Amazon Route 53 Amazon CloudFront Amazon S3 Amazon Cognito
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. App v4.0 Serverless option (be aware of limitations) Amazon DynamoDB AWS LambdaAmazon API Gateway Browser Amazon CloudFront Amazon S3 Amazon Cognito
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Caching layer
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ElastiCache RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone RDS DB Instance Standby (Multi-AZ) ELB User Amazon Route 53 Amazon CloudFront Amazon S3 App v5.0 Stateless application Web Instance Web Instance
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Elasticache Redis and Memcached • Transient session data • Shared state • High-frequency counters • Queues • Leaderboards • Lists, sets, … In-memory data store and cache
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Microseconds response times at millions of reads/sec from single DAX cluster • Reduce provisioned read capacity for DynamoDB tables for tables with hot data Amazon DynamoDB Accelerator (DAX) Read- and Write-Through Application DAX DynamoDB
  • 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. Sunday Monday Tuesday Wednesday Thursday Friday Saturday Typical weekly traffic to Amazon.com
  • 44. © 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
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. November November traffic to Amazon.com
  • 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. November November traffic to Amazon.com Provisioned capacity
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. November November traffic to Amazon.com Provisioned capacity 76% 24%
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto-Scaling • Compute efficiency • Node failure • Traffic spikes • Performance bugs
  • 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. November November traffic to Amazon.com with auto-scaling
  • 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone RDS DB Instance Standby (Multi-AZ) ELB App v6.0 Auto scaling groups User Amazon Route 53 Amazon CloudFront Amazon S3 Web Instances Web Instances ElastiCache Auto-Scaling group STATELESS
  • 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Users > 1,000,000
  • 52. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Databases
  • 53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Read / Write Sharding RDS DB Instance Read Replica App Instance App Instance App Instance RDS DB Instance Master (Multi-AZ) RDS DB Instance Read Replica RDS DB Instance Read Replica
  • 54. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Database Federation Users DB Products DB App Instance App Instance App Instance
  • 55. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Database Sharding User ShardID 002345 A 002346 B 002347 C 002348 B 002349 A CBA App Instance App Instance App Instance
  • 56. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Transient state does not belong in the database BUT is perfect in the cache!
  • 57. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Little story of Databases at Amazon “A deep dive on how we were using our existing databases revealed that they were frequently not used for their relational capabilities. About 70 percent of operations were of the key-value kind, where only a primary key was used and a single row would be returned. About 20 percent would return a set of rows, but still operate on only a single table.” Werner Vogels
  • 58. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Prime Day 2017 Metrics Block Storage – Use of Amazon Elastic Block Store (EBS) grew by 40% year-over-year, with aggregate data transfer jumping to 52 petabytes (a 50% increase) for the day and total I/O requests rising to 835 million (a 30% increase). NoSQL Database – Amazon DynamoDB requests from Alexa, the Amazon.com sites, and the Amazon fulfillment centers totaled 3.34 trillion, peaking at 12.9 million per second. Stack Creation – Nearly 31,000 AWS CloudFormation stacks were created for Prime Day in order to bring additional AWS resources on line. API Usage – AWS CloudTrail processed over 50 billion events and tracked more than 419 billion, all in support of Prime Day. Configuration Tracking – AWS Config generated over 14 million Configuration items for AWS resources.
  • 59. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Users > 10,000,000
  • 60. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Asynchronous patterns
  • 61. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CAP Theorem Consistency Availability Partition Tolerance Data is consistent. All nodes see the same state. Every request is non-failing. Service still responds as expected if some nodes crash. Distributed System In the presence of a network partition, you must choose between consistency and availability!
  • 62. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Eventual Consistency … if no new updates are made to a given data item, eventually all accesses to that item will return the last updated value. Availability An eventually consistent system can return any value before it converges!! https://en.wikipedia.org/wiki/Eventual_consistency Distributed System Every request is non-failing.
  • 63. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Process A Process B Process A Process B Synchronous Asynchronous Waiting Working Continues get or fetch resultGet result
  • 64. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Non-blocking UI https://medium.com/@sophie_paxtonUX/stop-getting-in-my-way-non-blocking-ux-5cbbfe0f0158
  • 65. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Message passing for async. patterns A Queue B A Queue BListener Pub-Sub
  • 66. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Web Instances Worker Instance Worker Instance Queue API Instance API Instance API Instance API: {DO foo} PUT JOB: {JobID: 0001, Task: DO foo} API: {JobID: 0001} GET JOB: {JobID: 0001, Task: DO foo} Cache Result: { JobID: 0001, Result: bar }
  • 67. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Worker Instance Worker Instance Queue API Instance API Instance API Instance Cache Amazon SNS Push Notification User
  • 68. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. RDS DB Instance Active (Multi-AZ) Availability Zone Elastic Load Balancer Web Instance Web Instance Amazon Route 53User Amazon S3 Amazon Cloudfront ElastiCache Worker Instance Worker Instance App v7.0 Full Decoupling Queue Amazon SNS
  • 69. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The Microservices Architecture
  • 70. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-driven patterns to the rescue
  • 71. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How Lambda works S3 event notifications DynamoDB Streams Kinesis events Cognito events SNS events Custom events CloudTrail events LambdaDynamoDB Kinesis S3 Any custom Invoked in response to events - Changes in data - Changes in state Redshift SNS Access any service, including your own Such as… Lambda functions CloudWatch events
  • 72. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-driven using Lambda and S3 AWS Lambda: Resize Images Users upload photos S3: Source Bucket S3: Destination Bucket Triggered on PUTs
  • 73. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-driven using Lambda and DynamoDB Amazon DynamoDB AWS Lambda Amazon DynamoDB Streams Actions Item Create Item Update Item Delete
  • 74. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Monitoring & Steady State
  • 75. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Monitoring, metrics, and logging • What are customers saying? • Try to squeeze as much performance out of each service/component Make it ridiculously easy to start monitoring a new metric! 1 line of code rule
  • 76. © 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved. AGGREGATE LEVEL METRICS LOG ANALYSIS EXTERNAL SITE PERFORMANCE HOST LEVEL METRICS
  • 77. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Steady State • ”normal” behavior of your system https://www.elastic.co/blog/timelion-tutorial-from-zero-to-hero
  • 78. Steady State • ”normal” behavior of your system • Business Metric https://medium.com/netflix-techblog/sps-the-pulse-of-netflix-streaming-ae4db0e05f8a
  • 79. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Increasing Resiliency
  • 80. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Circuit Breaker • Wrap a protected function call in a circuit breaker object, which monitors for failures. • If failures reach a certain threshold, the circuit breaker trips. https://martinfowler.com/bliki/CircuitBreaker.html
  • 81. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Service Degradation & Fallbacks
  • 82. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Save yourself a rollback ..
  • 83. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Immutable Infrastructure No updates on live systems • Always start from a new resource being provisioned • Deploy the new software • Test in different environments (dev, staging) • Deploy to prod (inactive) • Change references (DNS or Load Balancer) • Keep old version around (inactive) • Fast rollback if things go wrong
  • 84. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. New Version Users Canary deployment for Immutable Infra. Old Version 99% Users 1% Users Start with .. Dynamic Routing (Route53)
  • 85. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Time to Go Global!
  • 86. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. James Hamilton – 2016 re:Invent Vice President & Distinguished Engineer
  • 87. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Multi-Region Multi-VPC Connectivity
  • 88. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. S3 - Cross-Region Replication
  • 89. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cross-Region Read Replicas for Amazon RDS ** For Aurora, MySQL, MariaDB and PostgreSQL engines.
  • 90. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cross-Region Usage Pattern • Regional Reads • All critical writes traffic to a single master
  • 91. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora multi-master - scale out reads & writes First MySQL compatible DB service with scale-out across multiple data centers Zero application downtime from ANY instance failure Zero application downtime from ANY AZ failure Faster write performance and higher scale Sign up for single-region multi-master preview today; Multi-Region Multi-Master coming in 2018 Availability Zone 1 Scale out both reads and writes Availability Zone 2 Availability Zone 3 Application Read/Write Master 1 Shared distributed storage volume Read/Write Master 2 Read/Write Master 3
  • 92. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon DynamoDB Global Tables (GA) First fully managed, multi-master, multi-region database Build high performance, globally distributed applications Low latency reads & writes to locally available tables Disaster proof with multi-region redundancy Easy to set up and no application rewrites required Globally dispersed users Replica (N. America) Replica (Europe) Replica (Asia) Global App Global Table
  • 93. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon DynamoDB AWS LambdaAmazon API Gateway Amazon DynamoDB AWS LambdaAmazon API Gateway Amazon Route53 eu-west-1 us-east-1 GlobalTables https://globalddb.adhorn.me/
  • 94. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Users beyond 10,000,000
  • 95. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. … at the Edge
  • 96. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Fire Drills
  • 97. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Testing to the next level: Failure Injection • Start small & build confidence • Application level • Host failure • Resource attacks (CPU, memory, …) • Network attacks (dependencies, latency, …) • Region attacks!
  • 98. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Chaos Engineering
  • 99.
  • 100. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! @adhorn https://medium.com/@adhorn