SlideShare ist ein Scribd-Unternehmen logo
1 von 74
Downloaden Sie, um offline zu lesen
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!

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to AWS Step Functions
Introduction to AWS Step FunctionsIntroduction to AWS Step Functions
Introduction to AWS Step FunctionsAmazon Web Services
 
Introduction to Amazon Web Services
Introduction to Amazon Web ServicesIntroduction to Amazon Web Services
Introduction to Amazon Web ServicesRobert Greiner
 
Intro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute ServicesIntro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute ServicesAmazon Web Services
 
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and FargateDeep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and FargateAmazon Web Services
 
Getting Started with AWS Lambda and Serverless
Getting Started with AWS Lambda and ServerlessGetting Started with AWS Lambda and Serverless
Getting Started with AWS Lambda and ServerlessAmazon Web Services
 
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...Amazon Web Services
 
A Brief Look at Serverless Architecture
A Brief Look at Serverless ArchitectureA Brief Look at Serverless Architecture
A Brief Look at Serverless ArchitectureAmazon Web Services
 

Was ist angesagt? (20)

Amazon S3 Masterclass
Amazon S3 MasterclassAmazon S3 Masterclass
Amazon S3 Masterclass
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
Introduction to AWS Step Functions
Introduction to AWS Step FunctionsIntroduction to AWS Step Functions
Introduction to AWS Step Functions
 
What is AWS?
What is AWS?What is AWS?
What is AWS?
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Introduction to Amazon Web Services
Introduction to Amazon Web ServicesIntroduction to Amazon Web Services
Introduction to Amazon Web Services
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
Intro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute ServicesIntro to AWS: EC2 & Compute Services
Intro to AWS: EC2 & Compute Services
 
AWS Webcast - Website Hosting
AWS Webcast - Website HostingAWS Webcast - Website Hosting
AWS Webcast - Website Hosting
 
Getting Started with Amazon EC2
Getting Started with Amazon EC2Getting Started with Amazon EC2
Getting Started with Amazon EC2
 
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and FargateDeep Dive on Amazon Elastic Container Service (ECS) and Fargate
Deep Dive on Amazon Elastic Container Service (ECS) and Fargate
 
Serverless Architectures.pdf
Serverless Architectures.pdfServerless Architectures.pdf
Serverless Architectures.pdf
 
Security Best Practices
Security Best PracticesSecurity Best Practices
Security Best Practices
 
Getting Started with AWS Lambda and Serverless
Getting Started with AWS Lambda and ServerlessGetting Started with AWS Lambda and Serverless
Getting Started with AWS Lambda and Serverless
 
Cloud Foundations
Cloud FoundationsCloud Foundations
Cloud Foundations
 
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
 
A Brief Look at Serverless Architecture
A Brief Look at Serverless ArchitectureA Brief Look at Serverless Architecture
A Brief Look at Serverless Architecture
 
Deep dive into AWS IAM
Deep dive into AWS IAMDeep dive into AWS IAM
Deep dive into AWS IAM
 
Intro to AWS Lambda
Intro to AWS Lambda Intro to AWS Lambda
Intro to AWS Lambda
 
AWS 101
AWS 101AWS 101
AWS 101
 

Ähnlich wie Speed and Reliability at Any Scale with SQS and DB 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
 
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
 

Ähnlich wie Speed and Reliability at Any Scale with SQS and DB Services (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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Kürzlich hochgeladen (20)

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

Speed and Reliability at Any Scale with SQS and DB Services

  • 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!