Decoupling Applications - SNS/SNS + SQS Fan-Out Pattern Flashcards

1
Q

What is Amazon SNS (Simple Notification System)?

A

A fully managed publish-subscribe (Pub/Sub) messaging service that allows applications to send one message to many subscribers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Pub/Sub pattern?

A

A messaging pattern where:

Producers send messages to a topic (SNS topic).
Subscribers listen to the topic and receive messages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the benefits of using SNS over direct integrations?

A

Decoupling: The producer only sends messages to the SNS topic without worrying about individual subscribers.
Scalability: Supports up to 12,000,000+ subscriptions per topic.
Flexibility: New subscribers can be added without modifying the producer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What types of subscribers can SNS support?

A

Email
SMS and mobile notifications
HTTP/HTTPS endpoints
AWS Services:
SQS (queues)
Lambda (functions)
Kinesis Data Firehose (streaming to Redshift/S3)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which AWS services can send notifications to SNS?

A

CloudWatch Alarms
Auto Scaling Groups
S3 events
CloudFormation state changes
RDS events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does SNS handle security?

A

Encryption:
In-flight encryption by default.
At-rest encryption with KMS keys.
Client-side encryption (if implemented by the client).

Access Control:
Managed through IAM policies.
SNS access policies for cross-account access or service-specific permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the steps to use SNS?

A

Create a Topic: A logical access point for messages.
Create Subscriptions: Define who will receive messages.
Publish Messages: Send messages to the topic using the SNS SDK or console.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you control access to SNS topics?

A

Using SNS Access Policies, similar to S3 bucket policies, to allow:

Cross-account access.
Service integrations like S3 writing to SNS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the SNS + SQS Fan-Out Pattern?

A

A messaging architecture where:

Messages are sent to an SNS topic.
Multiple SQS queues are subscribed to the topic.
All subscribers receive a copy of each message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why use the Fan-Out Pattern?

A

Decoupling: The producer doesn’t directly interact with multiple queues.
Reliability: Ensures no message loss due to SQS persistence and retries.
Scalability: Easily add new queues as subscribers without modifying the producer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does SNS handle cross-region delivery?

A

SNS topics can send messages to SQS queues in different AWS regions if security policies allow it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Message Filtering in SNS?

A

A feature to filter messages sent to specific SNS subscriptions based on JSON policies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the benefits of Message Filtering?

A

Selective Delivery: Only relevant messages are sent to specific subscribers.
Reduced Processing Overhead: Avoids unnecessary processing for unrelated messages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly