Amazon SQS – Features and Limitations
Organizations often need to implement queue structures into their application when there is a need to process requests or messages on a First In First Out (FIFO) basis. Amazon Web Services offers a simple and reliable queue service called Amazon Simple Queue Service (SQS). This blog post is intended to summarize the features and limitations of SQS that will help organizations decide if Amazon SQS is the right service for them.
Here are the main features and benefits that come with Amazon SQS.
- Automatically distributes across multiple servers for redundancy and availability and locks items while being processed (visibility timeout)
- Items that fail to process can be moved to a “dead letter queue.” Organizations will need to put a process in place to make sure they investigate all failures before the dead letter queue times out.
- Supports long polling to reduce number of queue requests and the amount of polling required by consumers.
- Queues can be set-up as delay queues where received messages will not be available for a configured amount of time ― up to 15 minutes.
- Delays can be programmatically configured for individual messages using SDK/API.
- Up to 10 messages can be sent or received at a time in a batch provided total size of batch is less than 256K.
- Interacts with SQS via https get/post calls or via SDK.
- Authentication is enabled through IAM user access keys. Set up account for SQS use. Every request requires valid HMAC-SHA signature.
- Granular permissions are available for access to queue, controlling what IAM user/roles can receive, send, delete, change message visibility, or manipulate queue attributes. Anonymous queues can be configured as well (if needed).
- Messages can have typed attributes (e.g., string, number, binary + custom type – e.g. number, float).
Here are some other considerations:
- Message Lifecycle. It is important to understand different states of a message starting from creation till the point where the message is finally deleted from the queue. The following diagrams visualizes the complete lifecycle of the message.
- Possible Limitations. Before you make a decision to use Amazon SQS in your project, here are some possible limitations you must take in to account.
- Max message size is 256K. If you would want to store more than that, payload would need to be stored elsewhere.
- Messages can sit in queue for max of 14 days
- Limit of 120K in flight messages in the queue. In flight = received messages that have not yet been deleted – in that visibility timeout period.