Processing Notification and Queue data in AWS
Data ingestion in Batch (typically large datasets) and Real time (trickle feeds) are the most common forms of ingesting data. In this blog let us look processing the data which has been ingested via Notifications and Queues.
Notifications are typically used to inform users of
events, while queues are typically used to store and process messages in a
specific order.
Examples of notifications:
- An
email notification that you have received a new message.
- A
push notification on your phone that a new app update is available.
- A
pop-up notification on your computer that a new file has been downloaded.
Examples of queues:
- A
queue of print jobs waiting to be printed.
- A
queue of emails waiting to be sent.
- A
queue of tasks waiting to be executed by a background worker process.
The
table below summarizes some key concepts of Notifications and queues:
Feature |
Notification |
Queue |
Purpose |
To inform a recipient of an event. |
To store and process messages in a specific order. |
Delivery |
Notifications are typically delivered immediately to the
recipient. |
Messages are typically processed from a queue one at a time. |
Persistence |
Notifications are typically not stored persistently. |
Messages in a queue can be stored for long, so that they can be
retrieved and processed even if the system crashes or restarts. In Amazon
SQS, you can use the MessageRetentionPeriod parameter to set the message
retention period from 60 seconds (1 minute) to 1,209,600 seconds (14
days). |
Audience |
Notifications can be sent to one or more recipients. |
Messages in a queue are typically processed by a single
consumer. |
Architecture
flow:
Note – If you a continuous feed of Notifications and/or Queue messages, you can use Amazon ECS Fargate in place of AWS Lambda.
Conclusion:
Notifications and queues are both useful tools for communicating between different components of a software system. If you need to inform a user of an event, then a notification is the best choice. If you need to store and process messages in a specific order, then a queue is the best choice.
~Narendra V Joshi
Comments
Post a Comment