SlideShare a Scribd company logo
1 of 74
Download to read offline
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!

More Related Content

What's hot

AWS basics
AWS basicsAWS basics
AWS basicsmbaric
 
Decouple and Scale Applications Using Amazon SQS and Amazon SNS - July 2017 A...
Decouple and Scale Applications Using Amazon SQS and Amazon SNS - July 2017 A...Decouple and Scale Applications Using Amazon SQS and Amazon SNS - July 2017 A...
Decouple and Scale Applications Using Amazon SQS and Amazon SNS - July 2017 A...Amazon Web Services
 
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series Amazon Web Services Korea
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingAmazon Web Services
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Amazon 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
 
What's New in Amazon RDS for Open-Source & Commercial Databases
What's New in Amazon RDS for Open-Source & Commercial DatabasesWhat's New in Amazon RDS for Open-Source & Commercial Databases
What's New in Amazon RDS for Open-Source & Commercial DatabasesAmazon Web Services
 
Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)Amazon Web Services
 
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS SummitAmazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS SummitAmazon Web Services
 
Auto scaling using Amazon Web Services ( AWS )
Auto scaling using Amazon Web Services ( AWS )Auto scaling using Amazon Web Services ( AWS )
Auto scaling using Amazon Web Services ( AWS )Harish Ganesan
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless ArchitectureElana Krasner
 
AWS Storage - S3 Fundamentals
AWS Storage - S3 FundamentalsAWS Storage - S3 Fundamentals
AWS Storage - S3 FundamentalsPiyush Agrawal
 

What's hot (20)

AWS basics
AWS basicsAWS basics
AWS basics
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
Decouple and Scale Applications Using Amazon SQS and Amazon SNS - July 2017 A...
Decouple and Scale Applications Using Amazon SQS and Amazon SNS - July 2017 A...Decouple and Scale Applications Using Amazon SQS and Amazon SNS - July 2017 A...
Decouple and Scale Applications Using Amazon SQS and Amazon SNS - July 2017 A...
 
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
 
Getting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless ComputingGetting Started with AWS Lambda and Serverless Computing
Getting Started with AWS Lambda and Serverless Computing
 
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
Getting Started with Serverless Architectures with Microservices_AWSPSSummit_...
 
Auto Scaling on AWS
Auto Scaling on AWSAuto Scaling on AWS
Auto Scaling on AWS
 
AWS Simple Storage Service (s3)
AWS Simple Storage Service (s3) AWS Simple Storage Service (s3)
AWS Simple Storage Service (s3)
 
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
 
AWS Storage Options
AWS Storage OptionsAWS Storage Options
AWS Storage Options
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
What's New in Amazon RDS for Open-Source & Commercial Databases
What's New in Amazon RDS for Open-Source & Commercial DatabasesWhat's New in Amazon RDS for Open-Source & Commercial Databases
What's New in Amazon RDS for Open-Source & Commercial Databases
 
Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)Amazon Relational Database Service (Amazon RDS)
Amazon Relational Database Service (Amazon RDS)
 
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS SummitAmazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
Amazon RDS: Deep Dive - SRV310 - Chicago AWS Summit
 
Auto scaling using Amazon Web Services ( AWS )
Auto scaling using Amazon Web Services ( AWS )Auto scaling using Amazon Web Services ( AWS )
Auto scaling using Amazon Web Services ( AWS )
 
Security Best Practices on AWS
Security Best Practices on AWSSecurity Best Practices on AWS
Security Best Practices on AWS
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
Amazon simple queue service
Amazon simple queue serviceAmazon simple queue service
Amazon simple queue service
 
AWS Storage - S3 Fundamentals
AWS Storage - S3 FundamentalsAWS Storage - S3 Fundamentals
AWS Storage - S3 Fundamentals
 

Similar to 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 to 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
 

More from 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
 

More from 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
 

Recently uploaded

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

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!