AWS-SNS

Rishabh Verma
2 min readMar 5, 2023

--

[Simple Notification Service]

Prerequisites:

AWS- Lambda function and other basic services of AWS.

Problem Statement [Real Life]:

Suppose there is a company X that wants to send emails to their clients about their new product, but at the same time doesn’t want to bother the premium user to get spammed by this email. How can we control the broadcast of email in such a case ?

Problem Statement [in Programming]:

Suppose there is an AWS-Lambda function created for an application that deletes certain records but at the same time it is also necessary to notify the user about their records deletion. Its easier if the lambda function knows about all user details in advance, but what if it doesn’t ?

Solution:

There may be many approaches to solve this issue, but one of the efficient and optimum approach is AWS-SNS.

Introduction:

AWS-SNS is a messaging, publishing and processing service model, in short, PUB-SUB Model, provided by AWS. It is majorly used in cases where the demand is based on the [Publisher — Channel — Subscriber] Model. It allows it to reach millions of consumers/customers via [Email, HTTPS, Lambda Functions, SQS] and it is fully manageable and durable with auto-scaling.

Type of SNS -Models:

Before going through the Models, let us learn about some terminologies:

Based on how the [Publisher — Channel — Subscriber] model is used, there are two different kinds of Models:

1: Application to Person:

Publisher: Owner/ other application with valid credentials.
Channel: Topic [SNS-Topic],receives and publishes the input,
Subscriber: Person receiving Emails/ Text messages and mobile Notification.

2: Application to Application:

Publisher: Owner/ other application with valid credentials.
Channel: Topic [SNS-Topic],receives and publishes the input,
Subscriber: Others services like SQS, and HTTP/S Methods which receive
those input and perform other logic.

Attributes in SNS:

There are some attributes comes in picture that makes this model more scalable and useful.

TOPICS:

  • Subscriptions: Subscribers of a topic.
  • Access Policy: Owner/ authorized publisher
  • Data Protection Policy: Protect the published input.
  • Delivery Retry: Managing retry in case of failure/delay.
  • Encryption : Publish/ receive the topic in encrypted form.

SUBSCRIPTIONS

  • Subscriptions Filter Policy: Putting broadcast only on passing some conditions.
  • Re-drive Policy[dead-letter-queue]: Managing the failed notifications with a queue.

--

--