aws sqs intro
AWS Simple Queue Service (SQS) was the first AWS service that was publicly available. This is a message queue service that can store messages while waiting for an application to process them.
This enables web service applications to quickly and reliably queue messages that one component in the application generates for another component to consume.
A queue is a temporary repository for messages to wait to be processed.
The great thing about queues is that if the job fails or isn't completed due to an error, the message can still be picked up from the queue again.
Note: The messaging between application components needs to be polled, or checked, regularly.
A pull based system is what SQS utilizes. A push based notification system is what SNS (simple notification service) uses.
Features
- Decouple application components - decouple the components of an application so they run
independently, easing message management between componenets
- Store messages - any component of a distributed application can store messages in the queue.
Messages can contain up to 256KB of text in any format
- Retrieve messages - any component can later retrieve the messages programatically using
the SQS API
- SQS acts as a buffer between the ocmponent receiving the data for processing and the component
producing/saving the data
Benefits
- Resoles issues that arise if the producer is creating work faster than the consumer
can process it
- This also helps if the producer/consumer is only intermittently connected to the network
- Visibility timeout - Messages that are first picked up it is marked as "invisible"
to avoid another process from picking it up. There is a "visibility timeout" for the amount of time that the message can be processed. * If the message isn't processed in this timeframe, it will become available again. * The application server can fail, but the query itself is not lost and can be retried. * This concept is called decoupling your infrastructure
SQS general info
- Pull-based - SQS is pull-based not pushed-based
- Text data - including XML, JSON, unformatted text
- Guarantee - messages will be processed at least once
- Message size - 256KB
- Up to 14 days - Messages can be kept in the queue from 1 min to 14 days
- Default retention is 4 days
Exam tips
- SQS is a distributed message queueing system
- Allows us to decouple the components of an application so they are independent
- Pull-based, not push-based