SlideShare a Scribd company logo
1 of 29
Download to read offline
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hosted by AWS Technical Evangelists, Danilo Poccia & Ian Massingham
AWS Mobile Web Day
24th March 2016
Follow AWS on Twitter at @AWScloud & AWS Mobile Services at @awsmobile
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Best Practices: Infrastructure
Deployment and Monitoring with AWS
Lambda and Amazon SNS
Vyom Nagrani, Senior Product Manager, AWS Lambda
Amazon Simple Notification Service (SNS): publish
messages to multiple subscribers
• Follows the “publish-subscribe” (pub-
sub) messaging paradigm
• Group multiple recipients using topics
• Send to mobile device users, email
recipients or distributed services
• No upfront costs and pay as you go
pricing
Publisher
Subscriber
1
Subscriber
2
Subscriber
3
Subscriber
4
Amazon
SNS
Benefits of Amazon SNS for push notifications
“Fast, Flexible, Global Messaging to Any Device or Endpoint”
Global and Fast at Massive
Scale
Send billions of messages per
day with minimal latencies
across the world Use via Java, Python, PHP,
Node.js, or .NET
Support for Multiple Platforms or
Frameworks
Send Messages to Any Device or
Endpoint
Send Notifications via Mobile Push,
SQS, HTTP, Email, SMS, or
Lambda
AWS Lambda: A compute service that runs your code
in response to events
Lambda functions: Stateless, trigger-based code execution
Triggered by events:
• Direct Sync and Async invocations
• Put to an Amazon S3 bucket
• SNS subscription
• And many more …
Makes it easy to
• Build back-end services that perform at scale
• Perform data-driven auditing, analysis, and notification
High performance at any scale;
Cost-effective and efficient
No Infrastructure to manage
Pay only for what you use: Lambda
automatically matches capacity to
your request rate. Purchase
compute in 100ms increments.
Bring Your Own Code
“Productivity focused compute platform to build powerful, dynamic, modular
applications in the cloud”
Run code in a choice of standard
languages. Use threads, processes,
files, and shell scripts normally.
Focus on business logic, not
infrastructure. You upload code; AWS
Lambda handles everything else.
Benefits of AWS Lambda for building a server-less data
processing engine
1 2 3
Subscribe your Lambda functions to SNS topics
Customer
Systems
End-User Devices
(via AWS Mobile
SDK)
“Direct Publish”
publish (msg, endpointARN)
Topic
“A”
“Topic Publish”
publish(msg,topicArn)
APNSGCMADMWNS
Mobile Push Gateways
Amazon SQS Queues
HTTP Destinations
SMS (US Mobile Numbers Only)
Email
AWS Lambda Functions
Walkthrough of using an Amazon SNS message to
invoke AWS Lambda
Amazon
SNS
AWS Lambda Amazon
CloudWatch Logs
Publish
message to
topic
Attaching Lambda functions to Amazon SNS topic
subscriptions
• Multiple subscriptions: Subscribe multiple Lambda functions to same SNS topic
• For every subscribed function, each message to the SNS topic will invoke Lambda once
• Retries: For Amazon SNS, AWS Lambda retries each function at least 3 times
• Permission model: SNS pushes events to Lambda, so grant SNS invocation
permission through a resource policy, and add the execution role to Lambda
• Automatic Scaling: Lambda scales automatically with SNS publish rate
• Safety throttle of 100 concurrent Lambda functions, can be increased by AWS Support Center
Monitoring and Debugging Lambda functions
• Console Dashboard
• Lists all Lambda functions
• Easy editing of resources, event sources and other settings
• At-a-glance metrics
• Metrics in CloudWatch
• Requests
• Errors
• Latency
• Throttles
• Logging in CloudWatch Logs
Using SNS+Lambda for automated responses to alerts
(Infrastructure Monitoring and Deployment)
AWS
Lambda
Amazon
SNS
Amazon
CloudWatch Alarm
ec2
runInstance
ecs
startTask
beanstalk
updateApp
kinesis
splitShard
Any API call
Use cases of SNS+Lambda for Infrastructure
Monitoring and Automation
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
https://aws.amazon.com/blogs/compute/scaling-amazon-ecs-services-automatically-using-amazon-cloudwatch-and-aws-lambda/
Using Lambda to forward SNS messages to external
endpoints
http://danilop.net/aws/2015/07/26/sns2ifttt/ | https://github.com/danilop/SNS2IFTTT
AWS
Lambda
Amazon
SNS
IFTTT via
the Maker
channel
Amazon
CloudWatch Alarm
Amazon
AutoScaling
Using SNS fan out S3 event notifications to multiple
Lambda functions
https://aws.amazon.com/blogs/compute/fanout-s3-event-notifications-to-multiple-endpoints/
Amazon S3 Amazon SNS
AWS Lambda
Function 1
AWS Lambda
Function 2
Using SNS+Lambda to manage and deploy Lambda
functions
https://aws.amazon.com/blogs/compute/dynamic-github-actions-with-aws-lambda/
AWS
Lambda
Amazon
SNS
GitHub Repo
lambda
createFn ()
Three Next Steps
1. Create and test your first Amazon SNS topic. When publishers have information or
updates to notify their subscribers about, they can publish a message to the topic –
which immediately triggers Amazon SNS to deliver the message to all applicable
subscribers.
2. Create and test your first Lambda function. With AWS Lambda, there are no new
languages, tools, or frameworks to learn. You can use any third party library, even
native ones.
3. Subscribe your Lambda function to your SNS topic … A message delivery from
Amazon SNS to an AWS Lambda function creates an instance of the AWS Lambda
function and invokes it with your message as an input.
Thank you!
Visit http://aws.amazon.com/sns, the AWS
Mobile Development blog, and the SNS forum to
learn more and get started using Amazon SNS
Visit http://aws.amazon.com/lambda, the
AWS Compute blog, and the Lambda forum
to learn more and get started using Lambda.

More Related Content

What's hot

AWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver Klein
AWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver KleinAWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver Klein
AWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver Klein
Amazon Web Services Korea
 

What's hot (20)

AWS September Webinar Series - Build Cross-Platform Mobile Apps with AWS and...
AWS September Webinar Series -  Build Cross-Platform Mobile Apps with AWS and...AWS September Webinar Series -  Build Cross-Platform Mobile Apps with AWS and...
AWS September Webinar Series - Build Cross-Platform Mobile Apps with AWS and...
 
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
Build Your Mobile App Faster with AWS Mobile Services (Part 1 - AWS)
 
AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...
AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...
AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...
 
Mobile App Development with Amazon Web Services Mobile Hub
Mobile App Development with Amazon Web Services Mobile HubMobile App Development with Amazon Web Services Mobile Hub
Mobile App Development with Amazon Web Services Mobile Hub
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
AWS re:Invent 2016: All Your Chats are Belong to Bots: Building a Serverless ...
AWS re:Invent 2016: All Your Chats are Belong to Bots: Building a Serverless ...AWS re:Invent 2016: All Your Chats are Belong to Bots: Building a Serverless ...
AWS re:Invent 2016: All Your Chats are Belong to Bots: Building a Serverless ...
 
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
AWS re:Invent 2016: bots + serverless = ❤ (SVR304)
 
AWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver Klein
AWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver KleinAWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver Klein
AWS Innovate 2016: Build Mobile Apps using AWS SDKs and Mobile Hub- Oliver Klein
 
Build a Text Enabled Keg-orator Robot with Alexa, AWS IoT & AWS Lambda
Build a Text Enabled Keg-orator Robot with Alexa, AWS IoT & AWS LambdaBuild a Text Enabled Keg-orator Robot with Alexa, AWS IoT & AWS Lambda
Build a Text Enabled Keg-orator Robot with Alexa, AWS IoT & AWS Lambda
 
Deep Dive on Amazon Cognito - DevDay Los Angeles 2017
Deep Dive on Amazon Cognito - DevDay Los Angeles 2017Deep Dive on Amazon Cognito - DevDay Los Angeles 2017
Deep Dive on Amazon Cognito - DevDay Los Angeles 2017
 
Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK
Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDKDeep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK
Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK
 
NEW LAUNCH! Enhance Your Mobile Apps with AI Using Amazon Lex
NEW LAUNCH! Enhance Your Mobile Apps with AI Using Amazon LexNEW LAUNCH! Enhance Your Mobile Apps with AI Using Amazon Lex
NEW LAUNCH! Enhance Your Mobile Apps with AI Using Amazon Lex
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Journey Through the Cloud - Social & Mobile Apps
Journey Through the Cloud - Social & Mobile Apps Journey Through the Cloud - Social & Mobile Apps
Journey Through the Cloud - Social & Mobile Apps
 
Working with microservices and Amazon ECS at Airtime
Working with microservices and Amazon ECS at AirtimeWorking with microservices and Amazon ECS at Airtime
Working with microservices and Amazon ECS at Airtime
 
Mobile Web and App Development with AWS
Mobile Web and App Development with AWSMobile Web and App Development with AWS
Mobile Web and App Development with AWS
 
AWS re:Invent 2016: Deep Dive: Building and Delivering Mobile Apps for the En...
AWS re:Invent 2016: Deep Dive: Building and Delivering Mobile Apps for the En...AWS re:Invent 2016: Deep Dive: Building and Delivering Mobile Apps for the En...
AWS re:Invent 2016: Deep Dive: Building and Delivering Mobile Apps for the En...
 
(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS
(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS
(MBL202) Mobile State of the Union: Mobile Apps Powered by AWS
 
AWS 모바일 허브에서 모바일 프로그래밍하기 - 박선용 :: 2015 리인벤트 리캡 게이밍
AWS 모바일 허브에서 모바일 프로그래밍하기 - 박선용 :: 2015 리인벤트 리캡 게이밍AWS 모바일 허브에서 모바일 프로그래밍하기 - 박선용 :: 2015 리인벤트 리캡 게이밍
AWS 모바일 허브에서 모바일 프로그래밍하기 - 박선용 :: 2015 리인벤트 리캡 게이밍
 
AWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless CloudAWS Lambda and the Serverless Cloud
AWS Lambda and the Serverless Cloud
 

Viewers also liked

Viewers also liked (20)

Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API Gateway
 
Securing Serverless Architecture
Securing Serverless ArchitectureSecuring Serverless Architecture
Securing Serverless Architecture
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
 
Grow and Retain Users with Analytics and Push Notifications
Grow and Retain Users with Analytics and Push NotificationsGrow and Retain Users with Analytics and Push Notifications
Grow and Retain Users with Analytics and Push Notifications
 
Creating Your Virtual Data Center: Amazon VPC Fundamentals and Connectivity O...
Creating Your Virtual Data Center: Amazon VPC Fundamentals and Connectivity O...Creating Your Virtual Data Center: Amazon VPC Fundamentals and Connectivity O...
Creating Your Virtual Data Center: Amazon VPC Fundamentals and Connectivity O...
 
Serverless architecture
Serverless architectureServerless architecture
Serverless architecture
 
Using amazon machine learning to identify trends in io t data technical 201
Using amazon machine learning to identify trends in io t data   technical 201Using amazon machine learning to identify trends in io t data   technical 201
Using amazon machine learning to identify trends in io t data technical 201
 
Women in Technology: Supporting Diversity in a Technical Workplace
Women in Technology: Supporting Diversity in a Technical WorkplaceWomen in Technology: Supporting Diversity in a Technical Workplace
Women in Technology: Supporting Diversity in a Technical Workplace
 
AWSome Day Intro - Stockholm 20160308
AWSome Day Intro - Stockholm 20160308AWSome Day Intro - Stockholm 20160308
AWSome Day Intro - Stockholm 20160308
 
Sundog Media Toolkit
Sundog Media Toolkit Sundog Media Toolkit
Sundog Media Toolkit
 
AWS IoT - Introduction - Pop-up Loft
AWS IoT - Introduction - Pop-up LoftAWS IoT - Introduction - Pop-up Loft
AWS IoT - Introduction - Pop-up Loft
 
Ingest and storage options
Ingest and storage optionsIngest and storage options
Ingest and storage options
 
Simplestream
SimplestreamSimplestream
Simplestream
 
Event-Driven Serverless Apps - Pop-up Loft Tel Aviv
Event-Driven Serverless Apps - Pop-up Loft Tel AvivEvent-Driven Serverless Apps - Pop-up Loft Tel Aviv
Event-Driven Serverless Apps - Pop-up Loft Tel Aviv
 
Next Generation Open Data Platforms | AWS Public Sector Summit 2016
Next Generation Open Data Platforms | AWS Public Sector Summit 2016Next Generation Open Data Platforms | AWS Public Sector Summit 2016
Next Generation Open Data Platforms | AWS Public Sector Summit 2016
 
DevOps en Amazon: Un vistazo a nuestras herramientas y procesos
DevOps en Amazon: Un vistazo a nuestras herramientas y procesosDevOps en Amazon: Un vistazo a nuestras herramientas y procesos
DevOps en Amazon: Un vistazo a nuestras herramientas y procesos
 
Movidiam
MovidiamMovidiam
Movidiam
 
Docker for Mac
Docker for MacDocker for Mac
Docker for Mac
 
Amazon ECS – Production Docker at Scale
Amazon ECS – Production Docker at ScaleAmazon ECS – Production Docker at Scale
Amazon ECS – Production Docker at Scale
 

Similar to AWS Mobile with Lambda and SNS

AWS re:Invent 2020 Serverless Recap
AWS re:Invent 2020 Serverless RecapAWS re:Invent 2020 Serverless Recap
AWS re:Invent 2020 Serverless Recap
Daniel Zivkovic
 

Similar to AWS Mobile with Lambda and SNS (20)

AWS September Webinar Series - Infrastructure Deployment and Monitoring with ...
AWS September Webinar Series - Infrastructure Deployment and Monitoring with ...AWS September Webinar Series - Infrastructure Deployment and Monitoring with ...
AWS September Webinar Series - Infrastructure Deployment and Monitoring with ...
 
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
AWS October Webinar Series - AWS Lambda Best Practices: Python, Scheduled Job...
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS LambdaFebruary 2016 Webinar Series - Introducing VPC Support for AWS Lambda
February 2016 Webinar Series - Introducing VPC Support for AWS Lambda
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless Cloud
 
Zombie Apocalypse Workshop by Warren Santer and Kyle Somers, Solutions Archit...
Zombie Apocalypse Workshop by Warren Santer and Kyle Somers, Solutions Archit...Zombie Apocalypse Workshop by Warren Santer and Kyle Somers, Solutions Archit...
Zombie Apocalypse Workshop by Warren Santer and Kyle Somers, Solutions Archit...
 
Build a mobile app serverless with AWS Lambda
Build a mobile app serverless with AWS LambdaBuild a mobile app serverless with AWS Lambda
Build a mobile app serverless with AWS Lambda
 
AWS Serverless key services
AWS Serverless key servicesAWS Serverless key services
AWS Serverless key services
 
Compute Without Servers – Building Applications with AWS Lambda
Compute Without Servers – Building Applications with AWS LambdaCompute Without Servers – Building Applications with AWS Lambda
Compute Without Servers – Building Applications with AWS Lambda
 
AWS Lambda: Event-driven Code in the Cloud
AWS Lambda: Event-driven Code in the CloudAWS Lambda: Event-driven Code in the Cloud
AWS Lambda: Event-driven Code in the Cloud
 
AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...
AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...
AWS April Webinar Series - AWS Lambda: Event-driven Code for Devices and the ...
 
AWS Lambda: Event-driven Code for Devices and the Cloud
AWS Lambda: Event-driven Code for Devices and the CloudAWS Lambda: Event-driven Code for Devices and the Cloud
AWS Lambda: Event-driven Code for Devices and the Cloud
 
Build an App on AWS for Your First 10 Million Users
Build an App on AWS for Your First 10 Million UsersBuild an App on AWS for Your First 10 Million Users
Build an App on AWS for Your First 10 Million Users
 
AWS Services - Part 1
AWS Services - Part 1AWS Services - Part 1
AWS Services - Part 1
 
Messaging in the AWS Cloud
Messaging in the AWS CloudMessaging in the AWS Cloud
Messaging in the AWS Cloud
 
AWS re:Invent 2020 Serverless Recap
AWS re:Invent 2020 Serverless RecapAWS re:Invent 2020 Serverless Recap
AWS re:Invent 2020 Serverless Recap
 
AWS Lambda and Serverless Cloud
AWS Lambda and Serverless CloudAWS Lambda and Serverless Cloud
AWS Lambda and Serverless Cloud
 
Primeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverlessPrimeros pasos en desarrollo serverless
Primeros pasos en desarrollo serverless
 
A Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS LambdaA Walk in the Cloud with AWS Lambda
A Walk in the Cloud with AWS Lambda
 

More from Amazon Web Services

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

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

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

AWS Mobile with Lambda and SNS

  • 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Hosted by AWS Technical Evangelists, Danilo Poccia & Ian Massingham AWS Mobile Web Day 24th March 2016 Follow AWS on Twitter at @AWScloud & AWS Mobile Services at @awsmobile
  • 2. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Best Practices: Infrastructure Deployment and Monitoring with AWS Lambda and Amazon SNS Vyom Nagrani, Senior Product Manager, AWS Lambda
  • 3. Amazon Simple Notification Service (SNS): publish messages to multiple subscribers • Follows the “publish-subscribe” (pub- sub) messaging paradigm • Group multiple recipients using topics • Send to mobile device users, email recipients or distributed services • No upfront costs and pay as you go pricing Publisher Subscriber 1 Subscriber 2 Subscriber 3 Subscriber 4 Amazon SNS
  • 4. Benefits of Amazon SNS for push notifications “Fast, Flexible, Global Messaging to Any Device or Endpoint” Global and Fast at Massive Scale Send billions of messages per day with minimal latencies across the world Use via Java, Python, PHP, Node.js, or .NET Support for Multiple Platforms or Frameworks Send Messages to Any Device or Endpoint Send Notifications via Mobile Push, SQS, HTTP, Email, SMS, or Lambda
  • 5. AWS Lambda: A compute service that runs your code in response to events Lambda functions: Stateless, trigger-based code execution Triggered by events: • Direct Sync and Async invocations • Put to an Amazon S3 bucket • SNS subscription • And many more … Makes it easy to • Build back-end services that perform at scale • Perform data-driven auditing, analysis, and notification
  • 6. High performance at any scale; Cost-effective and efficient No Infrastructure to manage Pay only for what you use: Lambda automatically matches capacity to your request rate. Purchase compute in 100ms increments. Bring Your Own Code “Productivity focused compute platform to build powerful, dynamic, modular applications in the cloud” Run code in a choice of standard languages. Use threads, processes, files, and shell scripts normally. Focus on business logic, not infrastructure. You upload code; AWS Lambda handles everything else. Benefits of AWS Lambda for building a server-less data processing engine 1 2 3
  • 7. Subscribe your Lambda functions to SNS topics Customer Systems End-User Devices (via AWS Mobile SDK) “Direct Publish” publish (msg, endpointARN) Topic “A” “Topic Publish” publish(msg,topicArn) APNSGCMADMWNS Mobile Push Gateways Amazon SQS Queues HTTP Destinations SMS (US Mobile Numbers Only) Email AWS Lambda Functions
  • 8. Walkthrough of using an Amazon SNS message to invoke AWS Lambda Amazon SNS AWS Lambda Amazon CloudWatch Logs Publish message to topic
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Attaching Lambda functions to Amazon SNS topic subscriptions • Multiple subscriptions: Subscribe multiple Lambda functions to same SNS topic • For every subscribed function, each message to the SNS topic will invoke Lambda once • Retries: For Amazon SNS, AWS Lambda retries each function at least 3 times • Permission model: SNS pushes events to Lambda, so grant SNS invocation permission through a resource policy, and add the execution role to Lambda • Automatic Scaling: Lambda scales automatically with SNS publish rate • Safety throttle of 100 concurrent Lambda functions, can be increased by AWS Support Center
  • 22. Monitoring and Debugging Lambda functions • Console Dashboard • Lists all Lambda functions • Easy editing of resources, event sources and other settings • At-a-glance metrics • Metrics in CloudWatch • Requests • Errors • Latency • Throttles • Logging in CloudWatch Logs
  • 23. Using SNS+Lambda for automated responses to alerts (Infrastructure Monitoring and Deployment) AWS Lambda Amazon SNS Amazon CloudWatch Alarm ec2 runInstance ecs startTask beanstalk updateApp kinesis splitShard Any API call
  • 24. Use cases of SNS+Lambda for Infrastructure Monitoring and Automation 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 https://aws.amazon.com/blogs/compute/scaling-amazon-ecs-services-automatically-using-amazon-cloudwatch-and-aws-lambda/
  • 25. Using Lambda to forward SNS messages to external endpoints http://danilop.net/aws/2015/07/26/sns2ifttt/ | https://github.com/danilop/SNS2IFTTT AWS Lambda Amazon SNS IFTTT via the Maker channel Amazon CloudWatch Alarm Amazon AutoScaling
  • 26. Using SNS fan out S3 event notifications to multiple Lambda functions https://aws.amazon.com/blogs/compute/fanout-s3-event-notifications-to-multiple-endpoints/ Amazon S3 Amazon SNS AWS Lambda Function 1 AWS Lambda Function 2
  • 27. Using SNS+Lambda to manage and deploy Lambda functions https://aws.amazon.com/blogs/compute/dynamic-github-actions-with-aws-lambda/ AWS Lambda Amazon SNS GitHub Repo lambda createFn ()
  • 28. Three Next Steps 1. Create and test your first Amazon SNS topic. When publishers have information or updates to notify their subscribers about, they can publish a message to the topic – which immediately triggers Amazon SNS to deliver the message to all applicable subscribers. 2. Create and test your first Lambda function. With AWS Lambda, there are no new languages, tools, or frameworks to learn. You can use any third party library, even native ones. 3. Subscribe your Lambda function to your SNS topic … A message delivery from Amazon SNS to an AWS Lambda function creates an instance of the AWS Lambda function and invokes it with your message as an input.
  • 29. Thank you! Visit http://aws.amazon.com/sns, the AWS Mobile Development blog, and the SNS forum to learn more and get started using Amazon SNS Visit http://aws.amazon.com/lambda, the AWS Compute blog, and the Lambda forum to learn more and get started using Lambda.