© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Arjun Cholkar, AWS Principal Product Manager
Asha Chakrabarty, AWS Solutions Architect
Fabricio Pettena, COO LATAM, Rocket Internet
Eddie Dingels, Director of Architecture, Earth Networks
October 2015
MBL307
Scalable Messaging ArchitecturesHow Mobile Businesses and Enterprises Use Amazon SNS to Power Their
Messaging Needs
Amazon Simple Notification Service Fast, flexible, global messaging to any device or endpoint
Global and fast at
high scale
Send billions of
messages per day with
minimal latencies across
the world.
Send messages to any
device or endpoint
Send notifications
through mobile push,
email, HTTP or SMS, or
messages to Amazon
SQS or AWS Lambda.
Support for multiple
platforms or frameworks
Use Java, Python,
PHP, Node.js,
Objective-C, or .NET
One API - Multiple destination types
Back-end
systems(via AWS SDK)
End-user devices(via AWS Mobile SDK)
“Direct Publish”
publish(msg,endpointARN)
AP
NS
GC
MA
DM
WN
S
Mobile push gateways
iOS
Android
FireOS
Windows
“Topic Publish”
publish(msg,topicArn)
Amazon SQS queues
HTTP destinations
SMS (US mobile numbers)
AWS Lambda functions
@
100K Topics x 10Million Subs per Topic = 1Trillion Subs by Default
100K Topics
per account by
default
Publish messages in three simple steps
1Create a platform application
pReq = CreatePlatformApplicationRequest(“Foo”,”APNS”)
pArn = sns.createPlatformApplication(pReq)
2 Create a platform endpoint
eReq = CreatePlatformEndpointRequest(pArn, <TOKEN>)
eArn = sns.createPlatformEndpoint(eReq)
3 Publish to the platform endpoint
pubReq = PublishRequest(eArn, “SNS Direct Publish”)
sns.publish(pubReq)
1 Create a topic
tReq = CreateTopicRequest(“Bar”)
tArn = sns.createTopic(tReq)
2 Create a subscription (or many)
sReq = SubscribeRequest(tArn,”sqs”,qArn)
sArn = sns.subscribe(sReq)
3 Publish to the topic
pubReq = PublishRequest(tArn, “Topic Publish”)
sns.publish(pubReq)
Direct Publish Topic Publish
Engage users with intelligent push notifications
Analytics data
collectionAmazon Redshift
Marketing
App back endAmazon SNS
mobile push
Use analytics to target users with fine-grained push notifications
TAXIEASY Easy Taxi is one of the world’s most downloaded taxi apps.
Founded in June 2011 in Rio de Janeiro, Brazil, the service has
expanded to 30 countries and over 420 cities globally,
redefining the landscape of urban mobility.
① ride accepted
② taxi arrived
③ boarding
④ payment
⑤ rate the ride
SNS is part of
the ride workflow…
…and helps our CRM team
talk to millions of riders
and 400k+ drivers
promo codes
traffic alerts
campaigns
“care days”
partner programs
In sync with riders and drivers via mobile push
SNS driving the ride workflow
SNS
Handles delivery
Mobile Clients
• Push + deep links
• Assures workflow
• Generates engagement
Main API
• Auto Scaling group
• 000’s of txns/sec
MongoDB
on EC2
PHP
Ride Workflow
Running
on EC2
• Drives each step on the taxi rides
• Sends pushes for key events
• “Taxi arrived,” “Ride paid,” etc.
SNS enabling CRM activities through mobile
push
Marketing
teamPHP-based
scheduling
app
Standard segmentation• city/area
• driver or rider
Ad-hoc segmentation• top riders, drivers
• drivers near a POI now
• …
Queue• Beware of deep links
• Throttle at 6k/min
SNS
Handles delivery
Bigquery &
MongoDB
Mobile clients
Main API
…
Breaking news through SNS
PHP-based
“push console”
Newsroom
editor
National
NSW
Amazon
SNS
iOS
audience
Android
audience
Amazon
Cognito
2
1
Key Flows
1 Guest authentication with
Amazon Cognito
2
2 App registers with appropriate topics
Amazon
CloudWatch
Amazon
Kinesis
SumoLogic
GCM
APNS
3
3 Editor pushes a story
4
4
4 Clients load and display push
5
5 Logs and metrics gathered to
dashboard
From print to digital to mobile media
Migrated to SNS And in 2 months …
72% growth in push
notification volumes
89% growth in app
installs
204% growth in ad
impressions
• Established in 1948 and has print sales of 1.3 million copies daily as of 2015.
• Launched digital offering in 2009 and currently gets 150 million page views per day.
Entered into mobile,
but ran into …
Scalability challenges
High latency
Font limitations
User management
issues
Device management
issues
GCM
APNS
Amazon SNS
News category
to token mapping
Punjab Kesari
Back end
Punjab Kesari subscriber
SNS fan-out for S3 event notifications
• Event-driven data processing
architecture
• Parallel processing of same data
source
• SNS notifies different subscribers of
the S3 data event notifications
• Each subscriber processes the data
independently
• Data is stored in a storage
component of choice
Task automation with SNS, Lambda
Input from CloudWatch alarms
• EC2 metrics: CPU, disk, network, health
• EBS metrics: read/write bytes/ops
• ELB metrics: HTTPCode
• S3 metrics: NumberObjects, BucketSize
• DynamoDB metrics: read/write capacity
• Custom metrics/alarms
Output functionality
• Launch instance/tasks/apps
• Provision tables/shards/storage
• External endpoints
Using SNS as a messaging bus
• Decouple your architecture using SNS
• Use SQS for reliable storage of messages for immediate
or delayed processing
Amazon SNS
SQS queue
SQS queue
SQS queue
Company
Big data and IoT sensor networks
• World’s largest environmental sensor networks
• Extensive proprietary core sensor network & shared network sources
• Highest degree of environmental monitoring and prediction through
big data and algorithmic modeling
Co
re t
ec
hn
olo
gy
Ap
plic
ati
on
s
Consumer
• Local/accurate
• Safety
• Online
• Mobile
• Television
• Public safety
• Forecasting
• Environmental
• National agencies
Enterprise Government
• Safety
• Forecasting
• Energy
• Aviation
• Commercial
Smart Home
Intelligence
• Consumer
engagement
• Energy efficiency
• Demand response
Earth Networks ESB
Need
Reliable notifications between
decoupled services and tiers
Solution
SNS + SQS = Simple ESB
SQS
queue
SQS
queue
SQS
queue
SNS Topic
Earth Networks ESB
Tiers
• Alerts
• Surface observations
N pub to M sub
• Allows processing of each message at
an individual subscriber or set of
subscribers
• If a subscriber fails, can leave the
message on the queue for pickup
SQS queue
SNS Topic
Earth Networks ESB – Observation ingest
SNS Topic
SQS queue
SQS queue
SQS queue
Instance - FTP
Instances - UDP
Instance - ETL
Data marts
Data warehouse
Quality control
DynamoDB
Amazon
Redshift
50 million+ ESB messages per day
Earth Networks ESB
Fan-out
• Slowly moving data domains/dimensions
• Mapping (GIS)
1 pub to M sub
• Allows consistent fan-out to M number of
subscribers
• Ensures that each subscriber is eventually
consistent
SQS queue
SNS Topic
SNS Topic
SQS queue
SQS queue
Data
processing tier
Earth Networks ESB – Mapping data pipeline
Mapping
instance
Mapping
instance
CloudFrontELB
S3
SNS Topic -
radar
SNS Topic -
alerts
SQS queue
SQS queue
30 Distinct Data Topics
Earth Networks ESB
Aggregation
• Reporting
• KPI
N pub to 1 sub
• Allows aggregation and synchronization from
multiple sources without data loss
• Subscriber can be run in auto-scaling pool of
size 1
• Can add troubleshooting clients
SQS queue
SNS Topic
SNS at Earth Networks
• Solid notification platform
• Internal messaging
• Complex patterns supported with SQS
• Scales seamlessly
Summary
Amazon SNS is useful for
• Mobile and enterprise messaging workloads
• Direct messaging
• Broadcast messaging
• Targeted messaging
Create custom messaging architectures that scale by using Amazon SNS with • AWS application services like Amazon SQS
• AWS mobile services like Amazon Mobile Analytics
• AWS compute services like AWS Lambda
• AWS storage services like Amazon S3
• AWS management services like Amazon CloudWatch
Sessions you don’t want to miss!
MBL202
Mobile State of the
Union: Mobile Apps
Powered by AWS
Thursday, Oct 8th
1:30 PM - 2:30 PM
Palazzo K
WRK202
Rapid Mobile App
Development on AWS
Thursday, Oct 8th
3:15 PM – 5:15 PM
Galileo 1006
MBL309
Analyze Mobile App
Data and Build
Predictive Applications
Friday, Oct 9th
9:00 AM - 10:00 AM
Titian 2201B
Top Related