SlideShare uma empresa Scribd logo
1 de 116
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
© 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.
It’s not the single thing that
fixes everything.
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
What do we need first?
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Some basics…
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS Global Infrastructure
Region (# of Zones)
Coming Soon!
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AWS Global Infrastructure
Region (# of Zones)
Coming Soon!
100+ Edge
Locations
© 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
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Considerations
Rex Boggs
https://creativecommons.org/licenses/by-nd/2.0/
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
“Many decisions are
reversible, two-way
doors.”
-- Jeff Bezos
© 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.
So let’s start from…
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
You
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
1 User
Amazon
EC2
instance
Elastic IP
User
Amazon
Route 53
© 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
© 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
© 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
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >1
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users > 1
Web
Instance
Database
Instance
Elastic IP
User
Amazon
Route 53
© 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
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
To NoSQL, or not to NoSQL?
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Start with SQL databases
© 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.
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
AH HA! You said
“massive
amounts”
© 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.
© 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”
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users > 1
Registration,
Sign In, etc
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >100
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Users >1000
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Load Balancers
Classic Load BalancerApplication Load Balancer Network Load Balancer
© 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
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
horizontally
vertically
© 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.
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
© 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)
© 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)
© 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
© 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)
© 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
© 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
© 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
© 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!
© 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
© 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…
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Auto Scaling!
© 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.
Provisioned capacity
November
November traffic to Amazon.com
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
November traffic to Amazon.com
76%
24%
November
Provisioned capacity
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
November traffic to Amazon.com
November
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Auto Scaling
lets you do this!
© 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
© 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)
© 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)
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Use automation
© 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
© 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
© 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.
CloudWatch percentiles
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
The Monolithic Architecture
User Interface
Business Logic
Data Access
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
SOA
What does this mean?
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
The Service-Oriented Architecture
Presentation Tier Logic Tier
Data Tier
© 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
© 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
© 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
© 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
© 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
© 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
© 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.
Microservices in AWS
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Visualize service call graph
© 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.
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
© 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
© 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
Paolo Baire - Chief Architect
Marco Careddu - Web Architect
AWS Native WebApp
Who we are
USA
Mexico
Brazi
l
ItalySpai
n
Franc
e
Indonesia
Australi
a
Nuova
Zeland
a
Shopping Platform across 9 countries worldwide
Geolocalized information on promotions, new products, shops, opening times
Who we are
+150
Professionals
30M
Users
6
Officies
4
Countries
IN
66th
Fastest growing company
in Europe*
* Source: https://www.inc.com/profile/doveconviene---shopfully-international-group
Major Player in Online-to-Offline Shopping
Who we are
1.5M
Daily Flyer Views
20M
Daily Page Views
1 2
Where we are
Just migrated to AWS
from old legacy datacenter
PHP with LAMP stack
Migrated to ElasticBeanstalk
Scaling rely on AWS EC2 Autoscale
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
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
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
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
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
The Solution
1 Git Repository
2 CI with Code Pipeline
3 Host WebApp with S3
4 Served with CloudFront
A real example: a spike we had on 2nd March
0
22500
45000
67500
90000 Requests
A real example: a spike we had on 2nd March
0
30
60
90
120
150
Latency (ms) 503
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)
Thanks to
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
The next big steps
© 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)
© 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
© 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
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
A quick review
© 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
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
10+ million users!
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
To infinity...
© 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
© 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
© 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
© 2018, Amazon Web Services, Inc. or Its Affiliates. All rights reserved.
Thank You!

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech TalksAnalyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
 
Amazon GuardDuty Threat Detection and Remediation
Amazon GuardDuty Threat Detection and RemediationAmazon GuardDuty Threat Detection and Remediation
Amazon GuardDuty Threat Detection and Remediation
 
SRV327 Replicate, Analyze, and Visualize Data Using Managed Database and Ser...
 SRV327 Replicate, Analyze, and Visualize Data Using Managed Database and Ser... SRV327 Replicate, Analyze, and Visualize Data Using Managed Database and Ser...
SRV327 Replicate, Analyze, and Visualize Data Using Managed Database and Ser...
 
SRV321 Deep Dive on Amazon EBS
 SRV321 Deep Dive on Amazon EBS SRV321 Deep Dive on Amazon EBS
SRV321 Deep Dive on Amazon EBS
 
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
 
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
 
Data Privacy & Governance in the Age of Big Data: Deploy a De-Identified Data...
Data Privacy & Governance in the Age of Big Data: Deploy a De-Identified Data...Data Privacy & Governance in the Age of Big Data: Deploy a De-Identified Data...
Data Privacy & Governance in the Age of Big Data: Deploy a De-Identified Data...
 
AWS DeepLens Workshop_Build Computer Vision Applications
AWS DeepLens Workshop_Build Computer Vision Applications AWS DeepLens Workshop_Build Computer Vision Applications
AWS DeepLens Workshop_Build Computer Vision Applications
 
AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018
AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018
AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018
 
A Deep Dive into What's New for Amazon DynamoDB (DAT201) - AWS re:Invent 2018
A Deep Dive into What's New for Amazon DynamoDB (DAT201) - AWS re:Invent 2018A Deep Dive into What's New for Amazon DynamoDB (DAT201) - AWS re:Invent 2018
A Deep Dive into What's New for Amazon DynamoDB (DAT201) - AWS re:Invent 2018
 
DEM18 How SendBird Built a Serverless Log-Processing Pipeline in a Week
DEM18 How SendBird Built a Serverless Log-Processing Pipeline in a WeekDEM18 How SendBird Built a Serverless Log-Processing Pipeline in a Week
DEM18 How SendBird Built a Serverless Log-Processing Pipeline in a Week
 
Building low latency apps with a serverless architecture and in-memory data I...
Building low latency apps with a serverless architecture and in-memory data I...Building low latency apps with a serverless architecture and in-memory data I...
Building low latency apps with a serverless architecture and in-memory data I...
 
Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...
Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...
Introducing AWS Transfer for SFTP, a Fully Managed SFTP Service for Amazon S3...
 
Big Data and Alexa_Voice-Enabled Analytics
Big Data and Alexa_Voice-Enabled Analytics Big Data and Alexa_Voice-Enabled Analytics
Big Data and Alexa_Voice-Enabled Analytics
 
SRV303 Deep Dive on Amazon EFS
 SRV303 Deep Dive on Amazon EFS SRV303 Deep Dive on Amazon EFS
SRV303 Deep Dive on Amazon EFS
 
What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018
What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018
What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018
 
Best of AWS re:Invent 2017
Best of AWS re:Invent 2017Best of AWS re:Invent 2017
Best of AWS re:Invent 2017
 
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
Scaling Up to Your First 10 Million Users (ARC205-R1) - AWS re:Invent 2018
 
Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018
Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018
Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018
 
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
Reliable & Scalable Redis in the Cloud with Amazon ElastiCache (DAT202) - AWS...
 

Semelhante a Come scalare da zero ai tuoi primi 10 milioni di utenti.pdf

Semelhante a Come scalare da zero ai tuoi primi 10 milioni di utenti.pdf (20)

Scaling Up To and Beyond 10M Users
Scaling Up To and Beyond 10M UsersScaling Up To and Beyond 10M Users
Scaling Up To and Beyond 10M Users
 
Lessons Learned from a Large-Scale Legacy Migration with Sysco (STG311) - AWS...
Lessons Learned from a Large-Scale Legacy Migration with Sysco (STG311) - AWS...Lessons Learned from a Large-Scale Legacy Migration with Sysco (STG311) - AWS...
Lessons Learned from a Large-Scale Legacy Migration with Sysco (STG311) - AWS...
 
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
Build Your Own Log Analytics Solutions on AWS (ANT323-R) - AWS re:Invent 2018
 
Scaling up to and beyond 10M users
Scaling up to and beyond 10M usersScaling up to and beyond 10M users
Scaling up to and beyond 10M users
 
Introduction to Serverless on AWS - Builders Day Jerusalem
Introduction to Serverless on AWS - Builders Day JerusalemIntroduction to Serverless on AWS - Builders Day Jerusalem
Introduction to Serverless on AWS - Builders Day Jerusalem
 
Introduction to Serverless computing and AWS Lambda - Floor28
Introduction to Serverless computing and AWS Lambda - Floor28Introduction to Serverless computing and AWS Lambda - Floor28
Introduction to Serverless computing and AWS Lambda - Floor28
 
Introduction to Serverless computing and AWS Lambda | AWS Floor28
Introduction to Serverless computing and AWS Lambda | AWS Floor28Introduction to Serverless computing and AWS Lambda | AWS Floor28
Introduction to Serverless computing and AWS Lambda | AWS Floor28
 
Workshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data LakeWorkshop: Architecting a Serverless Data Lake
Workshop: Architecting a Serverless Data Lake
 
Operational Excellence with Containerized Workloads Using AWS Fargate (CON320...
Operational Excellence with Containerized Workloads Using AWS Fargate (CON320...Operational Excellence with Containerized Workloads Using AWS Fargate (CON320...
Operational Excellence with Containerized Workloads Using AWS Fargate (CON320...
 
深入淺出 Amazon Database Migration Service
深入淺出 Amazon Database Migration Service 深入淺出 Amazon Database Migration Service
深入淺出 Amazon Database Migration Service
 
Getting Started with Amazon Database Migration Service
Getting Started with Amazon Database Migration ServiceGetting Started with Amazon Database Migration Service
Getting Started with Amazon Database Migration Service
 
Serverless best practices plus design principles 20m version
Serverless   best practices plus design principles 20m versionServerless   best practices plus design principles 20m version
Serverless best practices plus design principles 20m version
 
Using Search with a Database - Peter Dachnowicz
Using Search with a Database - Peter DachnowiczUsing Search with a Database - Peter Dachnowicz
Using Search with a Database - Peter Dachnowicz
 
How Fannie Mae Processes over a Quarter Million Loans per Day with Amazon S3 ...
How Fannie Mae Processes over a Quarter Million Loans per Day with Amazon S3 ...How Fannie Mae Processes over a Quarter Million Loans per Day with Amazon S3 ...
How Fannie Mae Processes over a Quarter Million Loans per Day with Amazon S3 ...
 
AWSome Day - Solutions Architecture Best Practices
AWSome Day - Solutions Architecture Best PracticesAWSome Day - Solutions Architecture Best Practices
AWSome Day - Solutions Architecture Best Practices
 
Tape Is a Four Letter Word: Back Up to the Cloud in Under an Hour (STG201) - ...
Tape Is a Four Letter Word: Back Up to the Cloud in Under an Hour (STG201) - ...Tape Is a Four Letter Word: Back Up to the Cloud in Under an Hour (STG201) - ...
Tape Is a Four Letter Word: Back Up to the Cloud in Under an Hour (STG201) - ...
 
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
 
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
Best practices for optimizing your EC2 costs with Spot Instances | AWS Floor28
 
Data Warehouses and Data Lakes
Data Warehouses and Data LakesData Warehouses and Data Lakes
Data Warehouses and Data Lakes
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
 

Mais de Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Mais de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Come scalare da zero ai tuoi primi 10 milioni di utenti.pdf

  • 1. © 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
  • 89. Who we are USA Mexico Brazi l ItalySpai n Franc e Indonesia Australi a Nuova Zeland a Shopping Platform across 9 countries worldwide Geolocalized information on promotions, new products, shops, opening times
  • 90. Who we are +150 Professionals 30M Users 6 Officies 4 Countries IN 66th Fastest growing company in Europe* * Source: https://www.inc.com/profile/doveconviene---shopfully-international-group Major Player in Online-to-Offline Shopping
  • 91. Who we are 1.5M Daily Flyer Views 20M Daily Page Views 1 2
  • 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!