SlideShare una empresa de Scribd logo
1 de 74
Descargar para leer sin conexión
Speed and Reliability at Any Scale –
Combining SQS and DB Services
Jonathan Desrocher, Amazon Web Services
Colin Vipurs, Shazam Entertainment Ltd.
November 14, 2013

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
AWS Messaging = Amazon SQS + Amazon SNS
Amazon SQS Core Features

•
•

New and improved

Payload size of up to 256KB
Message batching for higher throughput and reduced costs

•

Supports long polling for reduced costs and latency

•

Cross-origin resource sharing support
SQS Core mechanics
Basic Message Lifecycle

Writer
Basic Message Lifecycle

Writer
Basic Message Lifecycle

Writer
Basic Message Lifecycle

Reader A

Reader B
Basic Message Lifecycle

Reader A

Reader B

ReceiveMessage

A

B
Basic Message Lifecycle

Reader A

Reader B

A

B
Basic Message Lifecycle

B

Reader B
Basic Message Lifecycle

Reader B
Basic Message Lifecycle

B

Reader B
Basic Message Lifecycle

Reader B
Basic Message Lifecycle

Reader B
That covers reliability.
Now let’s go for the scale!
Bulk Transactional Reads

Reader A
Bulk Transactional Reads

A

RAM: 10 Msgs

ReceiveMessage

A

A

A

A

Reader A

A
A

A

A

A
Bulk Transactional Reads

A

ReceiveMessage

A

A

A

A

Reader A

A
A

A

A

A

A

A

A

A

A

A

A

A

A

A

RAM: 20 Msgs
Bulk Transactional Reads

A

ReceiveMessage

A

A

A

A

Reader A

A
A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

A

RAM: 30 Msgs
Bulk Transactional Reads

Reader A

DeleteMessage
Bulk Transactional Reads

Reader A
Let’s take it to real life!
Scalability example: market trade volume by half hour
350,000
300,000
250,000
200,000
150,000

100,000
50,000
0
Scalability example: market trade volume by half hour
350,000
300,000
250,000
200,000

85%

150,000

100,000
50,000
0

15%
Design pattern #1:
Batch processing
Batch Processing
• Use SQS as a scalable and resilient short-term storage
solution.
• Simply configure the appropriate retention period and
send away!

SendMessage

HTTP PUT

Elastic Beanstalk Application
Batch Processing
• When appropriate, launch a fleet of Amazon EC2
workers and process the messages en masse.

ReceiveMessage
Design pattern #2:
IAM Roles for Amazon EC2
Using IAM Roles for Amazon EC2
• Create an IAM role with the
appropriate permissions to
Amazon SQS.
• Launch EC2 instances with
this role.
• Done!
– Audit logs will correlate
the EC2 instance ID to the
SQS API calls.
– IAM will automatically
rotate the credentials on
our behalf.

{

"Statement": [
{
"Sid": "Stmt1384277213171",
"Action": [
"sqs:ChangeMessageVisibility",
"sqs:DeleteMessage",
"sqs:GetQueueAttributes",
"sqs:GetQueueUrl",
"sqs:ListQueues",
"sqs:ReceiveMessage"
],
"Effect": "Allow",
"Resource": "arn:aws:sqs:us-east1:455320512810:Sensor_Ingestion"
}
]
}
Using IAM Roles for Amazon EC2
• Use the AWS SDK on the
Instance
• No need to type credentials
•
•
•

Not in code
Not in a configuration file
Not via the console either

require ‘rubygems’
require ‘aws-sdk’
sqs = AWS::SQS.new()
myqueue = sqs.queues.named("Sensor_Ingestion")
myqueue.poll do |msg|
# Do something with the message
end
Design pattern #3:
Using SQS to durably batch writes
Using SQS to durably batch writes
• The application:
–
–
–
–

An AWS Elastic Beanstalk application.
Clients upload data to the application through HTTP PUTs.
Each upload is 100KB in size.
Amazon S3 will be used as the permanent data store.

S3 PUT

HTTP PUT

Elastic Beanstalk Application

S3
Bucket
Using SQS to durably batch writes
• The challenge:
– We have an external constraint that requires us to batch the upload into
Amazon S3.
For example:
• Amazon EMR best practices call for Amazon S3 object size of >10MB.
• Hourly Amazon Redshift batch inserts.

EMR Cluster

S3 PUT

HTTP PUT

Elastic Beanstalk Application

S3
Bucket

Redshift Database
Using SQS to durably batch writes
• Enter SQS:
– Persist individual client PUTs as SQS messages.
– Have an Amazon EC2 worker role that performs the following logic:
• Receive SQS message and add to an in-memory buffer.
• Once buffer is full, upload to Amazon S3.
• Upon acknowledgement from S3, delete SQS messages from queue.

SendMessage

HTTP PUT

Elastic Beanstalk Application

ReceiveMessage

EMR
Cluster

S3 PUT

S3
Bucket

Redshift
Database
Using SQS to durably batch writes
• Also to consider:
– Some data stores are optimized for read workloads
– Buffering the writes with Simple Queue Service will ensure both speed
and reliability of data ingestion.

SendMessage

HTTP PUT

Elastic Beanstalk Application

ReceiveMessage

BatchWriteItem

RDS Database
Design pattern #4:
Discarding stale messages
Discarding stale messages
• Controlled via the MessageRetentionPeriod property.
• Useful when there is no business value for data older
than X minutes.
– “Transactions that don’t complete within 5 minutes are abandoned, enabling
client-side failure handling”.

SendMessage

HTTP PUT

Elastic Beanstalk Application

ReceiveMessage

[Stale Messages]

EMR
Cluster

S3 PUT

S3
Bucket

Redshift
Database
Design pattern #5:
Simple Notification Service Fan-out
Simple Notification Service Fan-out
•

Atomically distribute a message to
multiple subscribers over different
transport methods
–
–
–
–

•

SQS queues
HTTP/S endpoints
SMS
Email

Also used to abstract different mobile
device push providers (MBL308)
– Apple Push Notification Service
– Google Cloud Messaging for Android
– Amazon Device Messaging

Publish
Simple Notification Service Fan-out
• Perform different operations on the same data
– Split different facets of the payload into different systems.
– Duplicate the data into short-term and longterm storage systems.

ReceiveMessage

S3 PUT

S3
Bucket

EMR
Cluster

S3
Bucket

Redshift
Database

SNS Publish

HTTP PUT

Elastic Beanstalk Application

ReceiveMessage

S3 PUT
Simple Notification Service Fan-out
• Deliver the same data to different environments

Production
ReceiveMessage

S3 PUT

S3
Bucket

DynamoDB
Table

S3
Bucket

DynamoDB
Table

SNS Publish

HTTP PUT

Test

Elastic Beanstalk Application

ReceiveMessage

S3 PUT
Simple Notification Service Fan-out
• Distribute the same data to a multiple external environments:
– Push data to different locations worldwide.
– Seamlessly synchronize AWS and on-premises environments.
– Pro tip: MessageID field is consistent across locations.

us-east-1
eu-west-1
SNS Publish

HTTP PUT

Elastic Beanstalk Application

ap-northeast-1
On-premises Data Center
Simple Notification Service Fan-out
• Each recipient can have its own preferred transport protocol:
– SQS for guaranteed delivery
– Email for human-friendly delivery
– HTTP/S for real-time push

Partner/Process A
Partner/Process B
SNS Publish

HTTP PUT

Elastic Beanstalk Application

Partner/Process C
Partner/Process D
Design pattern #6:
Send messages from the browser
Send messages from the browser
• Make direct calls to AWS services such as SQS
and DynamoDB directly from the user’s browser.
• Authentication is based on STS tokens.
• Supports S3, SQS, SNS and DynamoDB.
Send messages from the browser
• Back to our sample architecture:
– Browser authenticates against Elastic Beanstalk application
– Response includes location of SQS Queue and STS Token for direct
authentication.

GetToken

Elastic Beanstalk Application

SendMessage

ReceiveMessage

EMR
Cluster

S3 PUT

S3
Bucket

Redshift
Database
Colin Vipurs
Shazam Entertainment Ltd.
375 MILLION
USERS

75 MILLION

MONTHLY ACTIVE USERS

10 MILLION
NEW USERS
PER MONTH
2004

2005

2006

2007

2008

2009

2010

2011

2012

2013
Amazon SQS for surge protection

SQS
shield
c3po

single event

message

update request

queue worker

user data

batch

data req.

Facebook Realtime Updates

user data

user updater

DynamoDB
Facebook Realtime Updates
Queue Worker Anatomy
operation
read msg

versioned msg

data object

target system
pollers

unmarshallers

handlers
SQS for SLAs

data
ingester
SQS for SLAs
high priority
batch
data
ingester

std priority

queue worker
low priority
SQS as DynamoDB Buffer
data
API

DynamoDb
Time

Traffic Volume
Traffic Volume

large volume
event

Time
SQS as DynamoDB Buffer
data
API

DynamoDb

throughtput exceeded

data

data
data message
queue worker
SQS as DynamoDB Buffer
data
API

client fails
fast

DynamoDb

data

queue worker

client
retries
SQS as DynamoDB Buffer

public interface Writer <T> {
void write(T t);
}
SNS/SQS Datastore Segregation
SNS/SQS Datastore Segregation
Reporting
S3
tag data
API

API
SNS/SQS Datastore Segregation
Reporting
S3
tag data
API

API

Dev Hacking
SQS for Shazam is…
•
•
•
•

Protection from the outside world
Short term, unbounded persistence
Cost effective elastic capacity
Scalable data segregation
Thank you Colin!
Design patterns recap
1.
2.
3.
4.
5.
6.

Batch processing
IAM Roles for EC2
Using SQS to durably batch writes
Discard stale messages
Simple Notification Service Fan-out
Send messages from the browser
Additional messaging resources
• Application Services Booth
• re:Invent sessions:
– ARC301 Controlling the Flood: Massive Message Processing with
AWS SQS and DynamoDB
– MBL308 Engage Your Customers with Amazon SNS Mobile Push

• AWS Support and Discussion Forums
• AWS Architecture Center:
http://aws.amazon.com/architecture
• Documentation:
http://aws.amazon.com/documentation/sqs
Next stop:
ARC301 - Controlling the Flood!
Right here in this room.
Please give us your feedback on this
presentation

SVC206
As a thank you, we will select prize
winners daily for completed surveys!

Más contenido relacionado

La actualidad más candente

AWS Connectivity, VPC Design and Security Pro Tips
AWS Connectivity, VPC Design and Security Pro TipsAWS Connectivity, VPC Design and Security Pro Tips
AWS Connectivity, VPC Design and Security Pro TipsShiva Narayanaswamy
 
Intro to Amazon S3
Intro to Amazon S3Intro to Amazon S3
Intro to Amazon S3Yu Lun Teo
 
Introduction to AWS Step Functions
Introduction to AWS Step FunctionsIntroduction to AWS Step Functions
Introduction to AWS Step FunctionsAmazon Web Services
 
Build a Website on AWS for Your First 10 Million Users
Build a Website on AWS for Your First 10 Million UsersBuild a Website on AWS for Your First 10 Million Users
Build a Website on AWS for Your First 10 Million UsersAmazon Web Services
 
Getting Started with AWS Compute Services
Getting Started with AWS Compute ServicesGetting Started with AWS Compute Services
Getting Started with AWS Compute ServicesAmazon Web Services
 
Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services Amazon Web Services
 
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...Edureka!
 

La actualidad más candente (20)

Deep Dive on AWS Lambda
Deep Dive on AWS LambdaDeep Dive on AWS Lambda
Deep Dive on AWS Lambda
 
AWS Connectivity, VPC Design and Security Pro Tips
AWS Connectivity, VPC Design and Security Pro TipsAWS Connectivity, VPC Design and Security Pro Tips
AWS Connectivity, VPC Design and Security Pro Tips
 
AWS CloudWatch
AWS CloudWatchAWS CloudWatch
AWS CloudWatch
 
Intro to Amazon S3
Intro to Amazon S3Intro to Amazon S3
Intro to Amazon S3
 
Amazon Simple Email Service
Amazon Simple Email ServiceAmazon Simple Email Service
Amazon Simple Email Service
 
Introduction to AWS Step Functions
Introduction to AWS Step FunctionsIntroduction to AWS Step Functions
Introduction to AWS Step Functions
 
AWS Cloud Watch
AWS Cloud WatchAWS Cloud Watch
AWS Cloud Watch
 
Introduction to Amazon S3
Introduction to Amazon S3Introduction to Amazon S3
Introduction to Amazon S3
 
Amazon CloudFront
Amazon CloudFrontAmazon CloudFront
Amazon CloudFront
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
AWS Technical Essentials Day
AWS Technical Essentials DayAWS Technical Essentials Day
AWS Technical Essentials Day
 
AWS Cloud Security Fundamentals
AWS Cloud Security FundamentalsAWS Cloud Security Fundamentals
AWS Cloud Security Fundamentals
 
Build a Website on AWS for Your First 10 Million Users
Build a Website on AWS for Your First 10 Million UsersBuild a Website on AWS for Your First 10 Million Users
Build a Website on AWS for Your First 10 Million Users
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
Architecting for AWS
Architecting for AWSArchitecting for AWS
Architecting for AWS
 
Getting Started with AWS Compute Services
Getting Started with AWS Compute ServicesGetting Started with AWS Compute Services
Getting Started with AWS Compute Services
 
Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services
 
AWS Architecting In The Cloud
AWS Architecting In The CloudAWS Architecting In The Cloud
AWS Architecting In The Cloud
 
AWS Cloud Security
AWS Cloud SecurityAWS Cloud Security
AWS Cloud Security
 
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
 

Similar a Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206) | AWS re:Invent 2013

Build A Website on AWS for Your First 10 Million Users
Build A Website on AWS for Your First 10 Million UsersBuild A Website on AWS for Your First 10 Million Users
Build A Website on AWS for Your First 10 Million UsersAmazon Web Services
 
Scaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersScaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersAmazon Web Services
 
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션Amazon Web Services Korea
 
Why Scale Matters and How the Cloud is Really Different (at scale)
Why Scale Matters and How the Cloud is Really Different (at scale)Why Scale Matters and How the Cloud is Really Different (at scale)
Why Scale Matters and How the Cloud is Really Different (at scale)Amazon Web Services
 
AWS Cloud Kata 2014 | Jakarta - 2-1 AWS Intro and Scale 2014
AWS Cloud Kata 2014 | Jakarta - 2-1 AWS Intro and Scale 2014AWS Cloud Kata 2014 | Jakarta - 2-1 AWS Intro and Scale 2014
AWS Cloud Kata 2014 | Jakarta - 2-1 AWS Intro and Scale 2014Amazon Web Services
 
AWS Summit Auckland 2014 | Running your First Application on AWS
AWS Summit Auckland 2014 | Running your First Application on AWSAWS Summit Auckland 2014 | Running your First Application on AWS
AWS Summit Auckland 2014 | Running your First Application on AWSAmazon Web Services
 
Best Practices Scaling Web Application Up to Your First 10 Million Users
Best Practices Scaling Web Application Up to Your First 10 Million UsersBest Practices Scaling Web Application Up to Your First 10 Million Users
Best Practices Scaling Web Application Up to Your First 10 Million UsersAmazon Web Services
 
What is Amazon Web Services & How to Start to deploy your apps ?
What is Amazon Web Services & How to Start to deploy your apps ?What is Amazon Web Services & How to Start to deploy your apps ?
What is Amazon Web Services & How to Start to deploy your apps ?Sébastien ☁ Stormacq
 
Running your First Application on AWS
Running your First Application on AWSRunning your First Application on AWS
Running your First Application on AWSAmazon Web Services
 
AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)
AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)
AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)Amazon Web Services
 
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWSAWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWSAmazon Web Services
 
ENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersAmazon Web Services
 
ENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersAmazon Web Services
 
ENT309 scaling up to your first 10 million users
ENT309 scaling up to your first 10 million usersENT309 scaling up to your first 10 million users
ENT309 scaling up to your first 10 million usersAmazon Web Services
 
AWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWSAWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWSAmazon Web Services
 
Amazon
AmazonAmazon
Amazoniamzkz
 
Building Highly Scalable Web Applications
Building Highly Scalable Web ApplicationsBuilding Highly Scalable Web Applications
Building Highly Scalable Web ApplicationsIWMW
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture PatternsAmazon Web Services
 
serverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfserverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfAmazon Web Services
 
Scaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinScaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinAmazon Web Services
 

Similar a Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206) | AWS re:Invent 2013 (20)

Build A Website on AWS for Your First 10 Million Users
Build A Website on AWS for Your First 10 Million UsersBuild A Website on AWS for Your First 10 Million Users
Build A Website on AWS for Your First 10 Million Users
 
Scaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersScaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million Users
 
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
윈도 닷넷 개발자를 위한 솔루션 클라우드 데브옵스 솔루션
 
Why Scale Matters and How the Cloud is Really Different (at scale)
Why Scale Matters and How the Cloud is Really Different (at scale)Why Scale Matters and How the Cloud is Really Different (at scale)
Why Scale Matters and How the Cloud is Really Different (at scale)
 
AWS Cloud Kata 2014 | Jakarta - 2-1 AWS Intro and Scale 2014
AWS Cloud Kata 2014 | Jakarta - 2-1 AWS Intro and Scale 2014AWS Cloud Kata 2014 | Jakarta - 2-1 AWS Intro and Scale 2014
AWS Cloud Kata 2014 | Jakarta - 2-1 AWS Intro and Scale 2014
 
AWS Summit Auckland 2014 | Running your First Application on AWS
AWS Summit Auckland 2014 | Running your First Application on AWSAWS Summit Auckland 2014 | Running your First Application on AWS
AWS Summit Auckland 2014 | Running your First Application on AWS
 
Best Practices Scaling Web Application Up to Your First 10 Million Users
Best Practices Scaling Web Application Up to Your First 10 Million UsersBest Practices Scaling Web Application Up to Your First 10 Million Users
Best Practices Scaling Web Application Up to Your First 10 Million Users
 
What is Amazon Web Services & How to Start to deploy your apps ?
What is Amazon Web Services & How to Start to deploy your apps ?What is Amazon Web Services & How to Start to deploy your apps ?
What is Amazon Web Services & How to Start to deploy your apps ?
 
Running your First Application on AWS
Running your First Application on AWSRunning your First Application on AWS
Running your First Application on AWS
 
AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)
AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)
AWS re:Invent 2016: IoT Visualizations and Analytics (IOT306)
 
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWSAWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
AWS Cloud Kata 2013 | Singapore - Getting to Scale on AWS
 
ENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million Users
 
ENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million UsersENT309 Scaling Up to Your First 10 Million Users
ENT309 Scaling Up to Your First 10 Million Users
 
ENT309 scaling up to your first 10 million users
ENT309 scaling up to your first 10 million usersENT309 scaling up to your first 10 million users
ENT309 scaling up to your first 10 million users
 
AWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWSAWS Cloud Kata | Manila - Getting to Scale on AWS
AWS Cloud Kata | Manila - Getting to Scale on AWS
 
Amazon
AmazonAmazon
Amazon
 
Building Highly Scalable Web Applications
Building Highly Scalable Web ApplicationsBuilding Highly Scalable Web Applications
Building Highly Scalable Web Applications
 
Serverless Architecture Patterns
Serverless Architecture PatternsServerless Architecture Patterns
Serverless Architecture Patterns
 
serverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdfserverless_architecture_patterns_london_loft.pdf
serverless_architecture_patterns_london_loft.pdf
 
Scaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinScaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit Dublin
 

Más de Amazon Web Services

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...Amazon Web Services
 
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...Amazon Web Services
 
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 FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
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 Amazon Web Services
 
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...Amazon Web Services
 
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...Amazon Web Services
 
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 WorkloadsAmazon Web Services
 
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 sfatareAmazon Web Services
 
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 NodeJSAmazon Web Services
 
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 webAmazon Web Services
 
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 sfatareAmazon 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 AWSAmazon 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 DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon 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
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Más 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
 

Último

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Último (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Speed and Reliability at Any Scale: Amazon SQS and Database Services (SVC206) | AWS re:Invent 2013

  • 1. Speed and Reliability at Any Scale – Combining SQS and DB Services Jonathan Desrocher, Amazon Web Services Colin Vipurs, Shazam Entertainment Ltd. November 14, 2013 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 2. AWS Messaging = Amazon SQS + Amazon SNS
  • 3. Amazon SQS Core Features • • New and improved Payload size of up to 256KB Message batching for higher throughput and reduced costs • Supports long polling for reduced costs and latency • Cross-origin resource sharing support
  • 9. Basic Message Lifecycle Reader A Reader B ReceiveMessage A B
  • 16. That covers reliability. Now let’s go for the scale!
  • 18. Bulk Transactional Reads A RAM: 10 Msgs ReceiveMessage A A A A Reader A A A A A A
  • 19. Bulk Transactional Reads A ReceiveMessage A A A A Reader A A A A A A A A A A A A A A A A RAM: 20 Msgs
  • 20. Bulk Transactional Reads A ReceiveMessage A A A A Reader A A A A A A A A A A A A A A A A A A A A A A A A A A RAM: 30 Msgs
  • 23. Let’s take it to real life!
  • 24. Scalability example: market trade volume by half hour 350,000 300,000 250,000 200,000 150,000 100,000 50,000 0
  • 25. Scalability example: market trade volume by half hour 350,000 300,000 250,000 200,000 85% 150,000 100,000 50,000 0 15%
  • 27. Batch Processing • Use SQS as a scalable and resilient short-term storage solution. • Simply configure the appropriate retention period and send away! SendMessage HTTP PUT Elastic Beanstalk Application
  • 28. Batch Processing • When appropriate, launch a fleet of Amazon EC2 workers and process the messages en masse. ReceiveMessage
  • 29. Design pattern #2: IAM Roles for Amazon EC2
  • 30. Using IAM Roles for Amazon EC2 • Create an IAM role with the appropriate permissions to Amazon SQS. • Launch EC2 instances with this role. • Done! – Audit logs will correlate the EC2 instance ID to the SQS API calls. – IAM will automatically rotate the credentials on our behalf. { "Statement": [ { "Sid": "Stmt1384277213171", "Action": [ "sqs:ChangeMessageVisibility", "sqs:DeleteMessage", "sqs:GetQueueAttributes", "sqs:GetQueueUrl", "sqs:ListQueues", "sqs:ReceiveMessage" ], "Effect": "Allow", "Resource": "arn:aws:sqs:us-east1:455320512810:Sensor_Ingestion" } ] }
  • 31. Using IAM Roles for Amazon EC2 • Use the AWS SDK on the Instance • No need to type credentials • • • Not in code Not in a configuration file Not via the console either require ‘rubygems’ require ‘aws-sdk’ sqs = AWS::SQS.new() myqueue = sqs.queues.named("Sensor_Ingestion") myqueue.poll do |msg| # Do something with the message end
  • 32. Design pattern #3: Using SQS to durably batch writes
  • 33. Using SQS to durably batch writes • The application: – – – – An AWS Elastic Beanstalk application. Clients upload data to the application through HTTP PUTs. Each upload is 100KB in size. Amazon S3 will be used as the permanent data store. S3 PUT HTTP PUT Elastic Beanstalk Application S3 Bucket
  • 34. Using SQS to durably batch writes • The challenge: – We have an external constraint that requires us to batch the upload into Amazon S3. For example: • Amazon EMR best practices call for Amazon S3 object size of >10MB. • Hourly Amazon Redshift batch inserts. EMR Cluster S3 PUT HTTP PUT Elastic Beanstalk Application S3 Bucket Redshift Database
  • 35. Using SQS to durably batch writes • Enter SQS: – Persist individual client PUTs as SQS messages. – Have an Amazon EC2 worker role that performs the following logic: • Receive SQS message and add to an in-memory buffer. • Once buffer is full, upload to Amazon S3. • Upon acknowledgement from S3, delete SQS messages from queue. SendMessage HTTP PUT Elastic Beanstalk Application ReceiveMessage EMR Cluster S3 PUT S3 Bucket Redshift Database
  • 36. Using SQS to durably batch writes • Also to consider: – Some data stores are optimized for read workloads – Buffering the writes with Simple Queue Service will ensure both speed and reliability of data ingestion. SendMessage HTTP PUT Elastic Beanstalk Application ReceiveMessage BatchWriteItem RDS Database
  • 38. Discarding stale messages • Controlled via the MessageRetentionPeriod property. • Useful when there is no business value for data older than X minutes. – “Transactions that don’t complete within 5 minutes are abandoned, enabling client-side failure handling”. SendMessage HTTP PUT Elastic Beanstalk Application ReceiveMessage [Stale Messages] EMR Cluster S3 PUT S3 Bucket Redshift Database
  • 39. Design pattern #5: Simple Notification Service Fan-out
  • 40. Simple Notification Service Fan-out • Atomically distribute a message to multiple subscribers over different transport methods – – – – • SQS queues HTTP/S endpoints SMS Email Also used to abstract different mobile device push providers (MBL308) – Apple Push Notification Service – Google Cloud Messaging for Android – Amazon Device Messaging Publish
  • 41. Simple Notification Service Fan-out • Perform different operations on the same data – Split different facets of the payload into different systems. – Duplicate the data into short-term and longterm storage systems. ReceiveMessage S3 PUT S3 Bucket EMR Cluster S3 Bucket Redshift Database SNS Publish HTTP PUT Elastic Beanstalk Application ReceiveMessage S3 PUT
  • 42. Simple Notification Service Fan-out • Deliver the same data to different environments Production ReceiveMessage S3 PUT S3 Bucket DynamoDB Table S3 Bucket DynamoDB Table SNS Publish HTTP PUT Test Elastic Beanstalk Application ReceiveMessage S3 PUT
  • 43. Simple Notification Service Fan-out • Distribute the same data to a multiple external environments: – Push data to different locations worldwide. – Seamlessly synchronize AWS and on-premises environments. – Pro tip: MessageID field is consistent across locations. us-east-1 eu-west-1 SNS Publish HTTP PUT Elastic Beanstalk Application ap-northeast-1 On-premises Data Center
  • 44. Simple Notification Service Fan-out • Each recipient can have its own preferred transport protocol: – SQS for guaranteed delivery – Email for human-friendly delivery – HTTP/S for real-time push Partner/Process A Partner/Process B SNS Publish HTTP PUT Elastic Beanstalk Application Partner/Process C Partner/Process D
  • 45. Design pattern #6: Send messages from the browser
  • 46. Send messages from the browser • Make direct calls to AWS services such as SQS and DynamoDB directly from the user’s browser. • Authentication is based on STS tokens. • Supports S3, SQS, SNS and DynamoDB.
  • 47. Send messages from the browser • Back to our sample architecture: – Browser authenticates against Elastic Beanstalk application – Response includes location of SQS Queue and STS Token for direct authentication. GetToken Elastic Beanstalk Application SendMessage ReceiveMessage EMR Cluster S3 PUT S3 Bucket Redshift Database
  • 49.
  • 50.
  • 51.
  • 52. 375 MILLION USERS 75 MILLION MONTHLY ACTIVE USERS 10 MILLION NEW USERS PER MONTH
  • 54. Amazon SQS for surge protection SQS shield
  • 55. c3po single event message update request queue worker user data batch data req. Facebook Realtime Updates user data user updater DynamoDB
  • 57. Queue Worker Anatomy operation read msg versioned msg data object target system pollers unmarshallers handlers
  • 59. SQS for SLAs high priority batch data ingester std priority queue worker low priority
  • 60. SQS as DynamoDB Buffer data API DynamoDb
  • 63. SQS as DynamoDB Buffer data API DynamoDb throughtput exceeded data data data message queue worker
  • 64. SQS as DynamoDB Buffer data API client fails fast DynamoDb data queue worker client retries
  • 65. SQS as DynamoDB Buffer public interface Writer <T> { void write(T t); }
  • 69. SQS for Shazam is… • • • • Protection from the outside world Short term, unbounded persistence Cost effective elastic capacity Scalable data segregation
  • 71. Design patterns recap 1. 2. 3. 4. 5. 6. Batch processing IAM Roles for EC2 Using SQS to durably batch writes Discard stale messages Simple Notification Service Fan-out Send messages from the browser
  • 72. Additional messaging resources • Application Services Booth • re:Invent sessions: – ARC301 Controlling the Flood: Massive Message Processing with AWS SQS and DynamoDB – MBL308 Engage Your Customers with Amazon SNS Mobile Push • AWS Support and Discussion Forums • AWS Architecture Center: http://aws.amazon.com/architecture • Documentation: http://aws.amazon.com/documentation/sqs
  • 73. Next stop: ARC301 - Controlling the Flood! Right here in this room.
  • 74. Please give us your feedback on this presentation SVC206 As a thank you, we will select prize winners daily for completed surveys!