SlideShare a Scribd company logo
@SrushithR
@SrushithR
Srushith Repakula
Head of Engineering, KonfHub
AWS Serverless Hero
Lessons Learned from Building a
Serverless Notifications System
@SrushithR
@SrushithR
Srushith Repakula
AWS Serverless Hero
Head of Engineering at KonfHub
Serverless Consultant
AWS UG Tirupati Lead
Co-organiser of Serverless Group
Host of ServerlessSaturdays
@SrushithR
Agenda
1. What did we try to solve?
2. How did we solve it?
3. Why Serverless?
4. Problems, challenges encountered and how we conquered it
5. Unconquered challenges
@SrushithR
● A highly scalable notification system that can deliver notifications to
hundreds of thousands of recipients
● Should work for multiple channels - Email, SMS and WhatsApp
● Should support instant launch and scheduled campaigns
● Handle duplicates
● Real time analytics on deliverability, open, and click rates
What did we try to solve?
@SrushithR
How did we solve it?
Amazon API Gateway Amazon Simple Queue
Service (Amazon SQS)
AWS Lambda
Amazon EventBridge
Amazon Simple Email
Service (Amazon SES)
Amazon Simple Notification
Service (Amazon SNS)
AWS Lambda
Amazon Cognito
Amazon DynamoDB
Amazon Aurora
Webhooks
@SrushithR
AWS Services used
● Amazon API Gateway
● Amazon Cognito
● AWS Lambda
● Amazon DynamoDB
● Amazon SQS
● Amazon Aurora
● Amazon EventBridge
● Amazon SES
● Amazon SNS
@SrushithR
@SrushithR
Problems and Challenges
● Deliverability of emails and domain reputation
● SQS - FIFO queue vs standard queue
● Throttling limits of the notification service providers. For example, number of
emails sent per second and per day
● Scalability, cost and time to finish the campaigns
● Lambda function’s max timeout of 15 minutes
● Scheduling of campaigns every minute
@SrushithR
Deliverability of emails and domain reputation
Dedicated IP
Each consumer uses a dedicated IP
address set for sending emails. For
example, one dedicated IP for
transactional, one for marketing, etc.
Shared IP
Multiple consumers use the same IP
set for sending emails
Pic credit:https://postmarkapp.com/guides/dedicated-vs-shared-ips-for-email-when-to-use-each
@SrushithR
Dedicated IP Addresses for Amazon SES
Standard
Refers to dedicated IP
addresses that you
manually set up and
manage, including the
option to manually warm
them up and scale them
out, and to manually move
them in and out of IP
pools
Managed
Refers to dedicated IP
addresses that are
automatically set up.
SES automatically warm
up for each ISP
individually and
auto-scale based on your
sending volume
Bring your own IP
addresses
Makes it possible to use your
own IP addresses to send
email through SES
Helpful when there is a
positive IP reputation built
using an in-house email
sending system, but want to
migrate to Amazon SES
@SrushithR
SQS - FIFO queue vs standard queue
Pic credit:https://www.bitslovers.com/sqs-fifo/
@SrushithR
SQS - FIFO queue vs standard queue: The case for FIFO
● Handling of duplicates and order
● Easier to understand the status of a campaign
● Unbatched throughput - 300
● Batched transactions per second FIFO - 3000
● Batched transactions per second for high throughput FIFO - 70,000*
● In flight messages per queue - 20,000
@SrushithR
● In flight messages per queue - 120,000
● Faster to process since there is no order to be maintained
● Cheaper in comparison to FIFO
SQS - FIFO queue vs standard queue: The case for Standard
@SrushithR
Although Standard queue increase application
layer complexity like
● Implementation of idempotency
● Extra processing for fetching the campaign
status
etc, Standard was the choice because:
● FIFO has only a 5-minute deduplication
interval
● Slower when hundreds of messages are
published within the same group
SQS - FIFO queue vs standard queue: Standard wins!
@SrushithR
Throttling limits are everywhere!
● Daily sending quota - the maximum number of emails that you can send in a
24-hour period
● Maximum send rate - the maximum number of emails that Amazon SES can
accept from the account each second. One can exceed this quota for short
bursts, but not for sustained periods of time.
Throttling limits of the notification service providers
@SrushithR
Conquering the throttling limits - Reserved Concurrency
● The concurrency limit is reserved just for the lambda function ensuring that there
are execution environments available and not shared with the account level
settings
● The maximum number of execution environment instances
● Throttled when the reserved concurrency limit is reached
@SrushithR
Conquering the throttling limits - Maximum concurrency for SQS
@SrushithR
Scheduling of campaigns every minute
The Challenges:
● Campaigns can be scheduled to the minute
● Scalability of the scheduler service - hundreds and thousands of
campaigns can be scheduled
@SrushithR
Scheduling of campaigns every minute
The Challenges:
● Campaigns can be scheduled to the minute
● Scalability of the scheduler service - hundreds and thousands of campaigns
can be scheduled
Common solution - run a cron job every minute to pick up campaigns that
are scheduled
Problems with this solution:
● Unnecessary costs involved in empty Lambda function invocations
● Increases application complexity
@SrushithR
Scheduling of campaigns every minute
@SrushithR
Unconquered Challenges
● Automated end-to-end testing of the entire architecture
● Observability and monitoring
● Automatic handling of service provider limits for “Bring your own provider”
use case
@SrushithR
Thank you!
https://www.linkedin.com/in/srushith/
@SrushithR

More Related Content

Similar to Lessons Learned from Building a Serverless Notifications System.pdf

ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost EfficiencyARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
Amazon Web Services
 
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost EfficiencyARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
Amazon Web Services
 
Operations: Cost Optimization - Don't Overspend on Infrastructure
Operations: Cost Optimization - Don't Overspend on Infrastructure Operations: Cost Optimization - Don't Overspend on Infrastructure
Operations: Cost Optimization - Don't Overspend on Infrastructure
Amazon Web Services
 
Amazon EC2
Amazon EC2Amazon EC2
Advanced Topics - Session 3 - Optimizing AWS Applications
Advanced Topics - Session 3 - Optimizing AWS ApplicationsAdvanced Topics - Session 3 - Optimizing AWS Applications
Advanced Topics - Session 3 - Optimizing AWS Applications
Amazon Web Services
 
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce CostsAWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
Amazon Web Services
 
SNS - SQS, and the MuleSoft liaison.pdf
SNS - SQS, and the MuleSoft liaison.pdfSNS - SQS, and the MuleSoft liaison.pdf
SNS - SQS, and the MuleSoft liaison.pdf
shyamraj55
 
Optimizing Your AWS Applications and Usage to Reduce Costs
Optimizing Your AWS Applications and Usage to Reduce CostsOptimizing Your AWS Applications and Usage to Reduce Costs
Optimizing Your AWS Applications and Usage to Reduce Costs
Amazon Web Services
 
Intro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesIntro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute Services
Amazon Web Services
 
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
Amazon Web Services
 
Intro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesIntro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute Services
Amazon Web Services
 
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
Chris Munns
 
AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...
AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...
AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...
Amazon Web Services
 
From 0 to 100M+ Emails Per Day: Sending Email with Amazon SES (SVC301) | AWS ...
From 0 to 100M+ Emails Per Day: Sending Email with Amazon SES (SVC301) | AWS ...From 0 to 100M+ Emails Per Day: Sending Email with Amazon SES (SVC301) | AWS ...
From 0 to 100M+ Emails Per Day: Sending Email with Amazon SES (SVC301) | AWS ...
Amazon Web Services
 
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
Amazon Web Services
 
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
Amazon Web Services
 
CMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot Fleet
CMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot FleetCMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot Fleet
CMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot Fleet
Amazon Web Services
 
Optimizing Your AWS Apps & Usage to Reduce Costs - IP Expo
Optimizing Your AWS Apps & Usage to Reduce Costs - IP ExpoOptimizing Your AWS Apps & Usage to Reduce Costs - IP Expo
Optimizing Your AWS Apps & Usage to Reduce Costs - IP Expo
Amazon Web Services
 
AWS Commercial Management and Cost Optimisation - Dec 2017
AWS Commercial Management and Cost Optimisation - Dec 2017AWS Commercial Management and Cost Optimisation - Dec 2017
AWS Commercial Management and Cost Optimisation - Dec 2017
Amazon Web Services
 
Prassnitha Sampath - Real Time Big Data Analytics with Kafka, Storm & HBase -...
Prassnitha Sampath - Real Time Big Data Analytics with Kafka, Storm & HBase -...Prassnitha Sampath - Real Time Big Data Analytics with Kafka, Storm & HBase -...
Prassnitha Sampath - Real Time Big Data Analytics with Kafka, Storm & HBase -...
NoSQLmatters
 

Similar to Lessons Learned from Building a Serverless Notifications System.pdf (20)

ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost EfficiencyARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
 
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost EfficiencyARC303_Running Lean Architectures How to Optimize for Cost Efficiency
ARC303_Running Lean Architectures How to Optimize for Cost Efficiency
 
Operations: Cost Optimization - Don't Overspend on Infrastructure
Operations: Cost Optimization - Don't Overspend on Infrastructure Operations: Cost Optimization - Don't Overspend on Infrastructure
Operations: Cost Optimization - Don't Overspend on Infrastructure
 
Amazon EC2
Amazon EC2Amazon EC2
Amazon EC2
 
Advanced Topics - Session 3 - Optimizing AWS Applications
Advanced Topics - Session 3 - Optimizing AWS ApplicationsAdvanced Topics - Session 3 - Optimizing AWS Applications
Advanced Topics - Session 3 - Optimizing AWS Applications
 
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce CostsAWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
AWS Sydney Summit 2013 - Optimizing AWS Applications and Usage to Reduce Costs
 
SNS - SQS, and the MuleSoft liaison.pdf
SNS - SQS, and the MuleSoft liaison.pdfSNS - SQS, and the MuleSoft liaison.pdf
SNS - SQS, and the MuleSoft liaison.pdf
 
Optimizing Your AWS Applications and Usage to Reduce Costs
Optimizing Your AWS Applications and Usage to Reduce CostsOptimizing Your AWS Applications and Usage to Reduce Costs
Optimizing Your AWS Applications and Usage to Reduce Costs
 
Intro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesIntro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute Services
 
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
Start Up Austin 2017: Don't Overspend! Cost Optimization Best Practices to Re...
 
Intro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesIntro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute Services
 
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
Serverless Streams, Topics, Queues, & APIs! Pick the Right Serverless Applica...
 
AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...
AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...
AWS re:Invent 2016: Beeswax: Building a Real-Time Streaming Data Platform on ...
 
From 0 to 100M+ Emails Per Day: Sending Email with Amazon SES (SVC301) | AWS ...
From 0 to 100M+ Emails Per Day: Sending Email with Amazon SES (SVC301) | AWS ...From 0 to 100M+ Emails Per Day: Sending Email with Amazon SES (SVC301) | AWS ...
From 0 to 100M+ Emails Per Day: Sending Email with Amazon SES (SVC301) | AWS ...
 
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
 
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
More Nines for Your Dimes: Improving Availability and Lowering Costs using Au...
 
CMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot Fleet
CMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot FleetCMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot Fleet
CMP316_Hedge Your Own Funds Run Monte Carlo Simulations on EC2 Spot Fleet
 
Optimizing Your AWS Apps & Usage to Reduce Costs - IP Expo
Optimizing Your AWS Apps & Usage to Reduce Costs - IP ExpoOptimizing Your AWS Apps & Usage to Reduce Costs - IP Expo
Optimizing Your AWS Apps & Usage to Reduce Costs - IP Expo
 
AWS Commercial Management and Cost Optimisation - Dec 2017
AWS Commercial Management and Cost Optimisation - Dec 2017AWS Commercial Management and Cost Optimisation - Dec 2017
AWS Commercial Management and Cost Optimisation - Dec 2017
 
Prassnitha Sampath - Real Time Big Data Analytics with Kafka, Storm & HBase -...
Prassnitha Sampath - Real Time Big Data Analytics with Kafka, Storm & HBase -...Prassnitha Sampath - Real Time Big Data Analytics with Kafka, Storm & HBase -...
Prassnitha Sampath - Real Time Big Data Analytics with Kafka, Storm & HBase -...
 

More from Srushith Repakula

How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
Srushith Repakula
 
Serverless - Your Gateway to the Cloud!
Serverless -  Your Gateway to the Cloud!Serverless -  Your Gateway to the Cloud!
Serverless - Your Gateway to the Cloud!
Srushith Repakula
 
Experiences in Architecting & Implementing Platforms using Serverless.pdf
Experiences in Architecting & Implementing Platforms using Serverless.pdfExperiences in Architecting & Implementing Platforms using Serverless.pdf
Experiences in Architecting & Implementing Platforms using Serverless.pdf
Srushith Repakula
 
Serverless: Beyond Lambda Functions (V2)
Serverless: Beyond Lambda Functions (V2)Serverless: Beyond Lambda Functions (V2)
Serverless: Beyond Lambda Functions (V2)
Srushith Repakula
 
Getting Started with Amazon EventBridge
Getting Started with Amazon EventBridgeGetting Started with Amazon EventBridge
Getting Started with Amazon EventBridge
Srushith Repakula
 
CICD in the World of Serverless
CICD in the World of ServerlessCICD in the World of Serverless
CICD in the World of Serverless
Srushith Repakula
 
Real Time Serverless Polling App
Real Time Serverless Polling AppReal Time Serverless Polling App
Real Time Serverless Polling App
Srushith Repakula
 
Serverless Workshop - Tomato Restaurant Rating App
Serverless Workshop - Tomato Restaurant Rating AppServerless Workshop - Tomato Restaurant Rating App
Serverless Workshop - Tomato Restaurant Rating App
Srushith Repakula
 
Become Thanos of the LambdaLand: Wield all the Infinity Stones
Become Thanos of the LambdaLand: Wield all the Infinity StonesBecome Thanos of the LambdaLand: Wield all the Infinity Stones
Become Thanos of the LambdaLand: Wield all the Infinity Stones
Srushith Repakula
 
Serverless by Examples and Case Studies
Serverless by Examples and Case StudiesServerless by Examples and Case Studies
Serverless by Examples and Case Studies
Srushith Repakula
 
Lambda land: Running a serverless ticketing platform for less than $2 a month
Lambda land: Running a serverless ticketing platform for less than $2 a monthLambda land: Running a serverless ticketing platform for less than $2 a month
Lambda land: Running a serverless ticketing platform for less than $2 a month
Srushith Repakula
 
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
 AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
Srushith Repakula
 
Chatbots with Serverless
Chatbots with ServerlessChatbots with Serverless
Chatbots with Serverless
Srushith Repakula
 
Keep Calm and Code Python - Build Cool Stuff Uing Python
Keep Calm and Code Python - Build Cool Stuff Uing PythonKeep Calm and Code Python - Build Cool Stuff Uing Python
Keep Calm and Code Python - Build Cool Stuff Uing Python
Srushith Repakula
 
Serverless: Why is it hot and What is it not?
Serverless: Why is it hot and What is it not?Serverless: Why is it hot and What is it not?
Serverless: Why is it hot and What is it not?
Srushith Repakula
 
Scheduled Retweets Using AWS Lambda
Scheduled Retweets Using AWS LambdaScheduled Retweets Using AWS Lambda
Scheduled Retweets Using AWS Lambda
Srushith Repakula
 

More from Srushith Repakula (16)

How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Serverless - Your Gateway to the Cloud!
Serverless -  Your Gateway to the Cloud!Serverless -  Your Gateway to the Cloud!
Serverless - Your Gateway to the Cloud!
 
Experiences in Architecting & Implementing Platforms using Serverless.pdf
Experiences in Architecting & Implementing Platforms using Serverless.pdfExperiences in Architecting & Implementing Platforms using Serverless.pdf
Experiences in Architecting & Implementing Platforms using Serverless.pdf
 
Serverless: Beyond Lambda Functions (V2)
Serverless: Beyond Lambda Functions (V2)Serverless: Beyond Lambda Functions (V2)
Serverless: Beyond Lambda Functions (V2)
 
Getting Started with Amazon EventBridge
Getting Started with Amazon EventBridgeGetting Started with Amazon EventBridge
Getting Started with Amazon EventBridge
 
CICD in the World of Serverless
CICD in the World of ServerlessCICD in the World of Serverless
CICD in the World of Serverless
 
Real Time Serverless Polling App
Real Time Serverless Polling AppReal Time Serverless Polling App
Real Time Serverless Polling App
 
Serverless Workshop - Tomato Restaurant Rating App
Serverless Workshop - Tomato Restaurant Rating AppServerless Workshop - Tomato Restaurant Rating App
Serverless Workshop - Tomato Restaurant Rating App
 
Become Thanos of the LambdaLand: Wield all the Infinity Stones
Become Thanos of the LambdaLand: Wield all the Infinity StonesBecome Thanos of the LambdaLand: Wield all the Infinity Stones
Become Thanos of the LambdaLand: Wield all the Infinity Stones
 
Serverless by Examples and Case Studies
Serverless by Examples and Case StudiesServerless by Examples and Case Studies
Serverless by Examples and Case Studies
 
Lambda land: Running a serverless ticketing platform for less than $2 a month
Lambda land: Running a serverless ticketing platform for less than $2 a monthLambda land: Running a serverless ticketing platform for less than $2 a month
Lambda land: Running a serverless ticketing platform for less than $2 a month
 
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
 AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
AWS Lambda Hands-on: How to Create Phone Call Notifications in a Serverless Way
 
Chatbots with Serverless
Chatbots with ServerlessChatbots with Serverless
Chatbots with Serverless
 
Keep Calm and Code Python - Build Cool Stuff Uing Python
Keep Calm and Code Python - Build Cool Stuff Uing PythonKeep Calm and Code Python - Build Cool Stuff Uing Python
Keep Calm and Code Python - Build Cool Stuff Uing Python
 
Serverless: Why is it hot and What is it not?
Serverless: Why is it hot and What is it not?Serverless: Why is it hot and What is it not?
Serverless: Why is it hot and What is it not?
 
Scheduled Retweets Using AWS Lambda
Scheduled Retweets Using AWS LambdaScheduled Retweets Using AWS Lambda
Scheduled Retweets Using AWS Lambda
 

Recently uploaded

Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 

Recently uploaded (20)

Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 

Lessons Learned from Building a Serverless Notifications System.pdf

  • 1. @SrushithR @SrushithR Srushith Repakula Head of Engineering, KonfHub AWS Serverless Hero Lessons Learned from Building a Serverless Notifications System
  • 2. @SrushithR @SrushithR Srushith Repakula AWS Serverless Hero Head of Engineering at KonfHub Serverless Consultant AWS UG Tirupati Lead Co-organiser of Serverless Group Host of ServerlessSaturdays
  • 3. @SrushithR Agenda 1. What did we try to solve? 2. How did we solve it? 3. Why Serverless? 4. Problems, challenges encountered and how we conquered it 5. Unconquered challenges
  • 4. @SrushithR ● A highly scalable notification system that can deliver notifications to hundreds of thousands of recipients ● Should work for multiple channels - Email, SMS and WhatsApp ● Should support instant launch and scheduled campaigns ● Handle duplicates ● Real time analytics on deliverability, open, and click rates What did we try to solve?
  • 5. @SrushithR How did we solve it? Amazon API Gateway Amazon Simple Queue Service (Amazon SQS) AWS Lambda Amazon EventBridge Amazon Simple Email Service (Amazon SES) Amazon Simple Notification Service (Amazon SNS) AWS Lambda Amazon Cognito Amazon DynamoDB Amazon Aurora Webhooks
  • 6. @SrushithR AWS Services used ● Amazon API Gateway ● Amazon Cognito ● AWS Lambda ● Amazon DynamoDB ● Amazon SQS ● Amazon Aurora ● Amazon EventBridge ● Amazon SES ● Amazon SNS
  • 8. @SrushithR Problems and Challenges ● Deliverability of emails and domain reputation ● SQS - FIFO queue vs standard queue ● Throttling limits of the notification service providers. For example, number of emails sent per second and per day ● Scalability, cost and time to finish the campaigns ● Lambda function’s max timeout of 15 minutes ● Scheduling of campaigns every minute
  • 9. @SrushithR Deliverability of emails and domain reputation Dedicated IP Each consumer uses a dedicated IP address set for sending emails. For example, one dedicated IP for transactional, one for marketing, etc. Shared IP Multiple consumers use the same IP set for sending emails Pic credit:https://postmarkapp.com/guides/dedicated-vs-shared-ips-for-email-when-to-use-each
  • 10. @SrushithR Dedicated IP Addresses for Amazon SES Standard Refers to dedicated IP addresses that you manually set up and manage, including the option to manually warm them up and scale them out, and to manually move them in and out of IP pools Managed Refers to dedicated IP addresses that are automatically set up. SES automatically warm up for each ISP individually and auto-scale based on your sending volume Bring your own IP addresses Makes it possible to use your own IP addresses to send email through SES Helpful when there is a positive IP reputation built using an in-house email sending system, but want to migrate to Amazon SES
  • 11. @SrushithR SQS - FIFO queue vs standard queue Pic credit:https://www.bitslovers.com/sqs-fifo/
  • 12. @SrushithR SQS - FIFO queue vs standard queue: The case for FIFO ● Handling of duplicates and order ● Easier to understand the status of a campaign ● Unbatched throughput - 300 ● Batched transactions per second FIFO - 3000 ● Batched transactions per second for high throughput FIFO - 70,000* ● In flight messages per queue - 20,000
  • 13. @SrushithR ● In flight messages per queue - 120,000 ● Faster to process since there is no order to be maintained ● Cheaper in comparison to FIFO SQS - FIFO queue vs standard queue: The case for Standard
  • 14. @SrushithR Although Standard queue increase application layer complexity like ● Implementation of idempotency ● Extra processing for fetching the campaign status etc, Standard was the choice because: ● FIFO has only a 5-minute deduplication interval ● Slower when hundreds of messages are published within the same group SQS - FIFO queue vs standard queue: Standard wins!
  • 15. @SrushithR Throttling limits are everywhere! ● Daily sending quota - the maximum number of emails that you can send in a 24-hour period ● Maximum send rate - the maximum number of emails that Amazon SES can accept from the account each second. One can exceed this quota for short bursts, but not for sustained periods of time. Throttling limits of the notification service providers
  • 16. @SrushithR Conquering the throttling limits - Reserved Concurrency ● The concurrency limit is reserved just for the lambda function ensuring that there are execution environments available and not shared with the account level settings ● The maximum number of execution environment instances ● Throttled when the reserved concurrency limit is reached
  • 17. @SrushithR Conquering the throttling limits - Maximum concurrency for SQS
  • 18. @SrushithR Scheduling of campaigns every minute The Challenges: ● Campaigns can be scheduled to the minute ● Scalability of the scheduler service - hundreds and thousands of campaigns can be scheduled
  • 19. @SrushithR Scheduling of campaigns every minute The Challenges: ● Campaigns can be scheduled to the minute ● Scalability of the scheduler service - hundreds and thousands of campaigns can be scheduled Common solution - run a cron job every minute to pick up campaigns that are scheduled Problems with this solution: ● Unnecessary costs involved in empty Lambda function invocations ● Increases application complexity
  • 21. @SrushithR Unconquered Challenges ● Automated end-to-end testing of the entire architecture ● Observability and monitoring ● Automatic handling of service provider limits for “Bring your own provider” use case