Day 8: SQS &SNS
ππ¦ππ³π¨π§ πππ:
π Standard Queue, Decouple applications, Unlimited throughput
π Producing VS Consumers, Poll SQS, Multiple EC2, ASG
π Security (KMS keys, IAM policies, SNS Access Policies), FIFO Topic
π Message Visibility Timeout, Long Polling, Buffer to database writes
ππ¦ππ³π¨π§ πππ:
π One message to many receivers, As many event receivers (subscriptions),
π Integrates with a lot of AWS services, Topic Publish, Direct Publish, SNS + SQS: Fan Out
π SNS Security (KMS keys, IAM policies, SNS Access Policies), SNS FIFO Topic
π SNS β Message Filtering
Amazon SQS (Simple Queue Service):
π Standard Queue, decouple applications, Unlimited throughput: SQS is used to decouple the components of a cloud application. It offers standard queues for asynchronous messaging with high throughput.
π Producing VS Consumers, Poll SQS, Multiple EC2, ASG: You can have producers and consumers in your architecture. Consumers poll SQS for messages. It can be used with multiple EC2 instances and Auto Scaling Groups (ASG) for scalability.
π Security (KMS keys, IAM policies, SNS Access Policies), FIFO Topic: You can secure SQS with KMS (Key Management Service) keys and IAM (Identity and Access Management) policies. However, SQS uses FIFO (First-In-First-Out) only for message queues, not topics.
π Message Visibility Timeout, Long Polling, Buffer to database writes: You can set a message visibility timeout to prevent other consumers from processing the same message. Long polling reduces the number of empty responses when there are no messages. SQS is often used to buffer messages for database writes.
Amazon SNS (Simple Notification Service):
π One message to many receivers, as many event receivers (subscriptions): SNS allows you to send a message to multiple receivers. You can have many subscriptions to a topic, each representing a different endpoint or service.
π Integrates with a lot of AWS services, Topic Publish, Direct Publish, SNS + SQS: Fan Out: SNS integrates with various AWS services and can publish messages to topics, which can then fan out to multiple subscribers, including SQS queues.
π SNS Security (KMS keys, IAM policies, SNS Access Policies), SNS FIFO Topic: SNS supports security measures like KMS keys and IAM policies. It also has FIFO (First-In-First-Out) topics for guaranteed message ordering.
π SNS β Message Filtering: SNS allows message filtering to deliver messages only to subscribers that have expressed interest in specific message attributes.
Use Cases:
Amazon SQS Use Cases:
- Efficient Order Processing with Amazon SQS
- Scalable Image Processing with SQS
- Log Aggregation Made Easy with Amazon SQS
Amazon SNS Use Cases:
- Real-time Alerts and Notifications with SNS
- Instant Financial Market Updates via SNS
- Managing IoT Device Communication using SNS