What is SQS ? Introduction to AMAZON SIMPLE QUEUE SERVICE
What is AWS SQS it is a queuing service provided by Amazon for sending, storing, retrieving messages via web service applications as a way of communications.
Basically, it provides different applications to transfer messages. The queue service follows the producer/consumer paradigm.
Producer applications are responsible for sending messages to the queue, and consumer applications are responsible for reading the messages from the queue.
Consumer applications can read messages at any time, it’s not required to have connection established to the queue. Whenever the consumer application is connected, it read the message from the queueing service. The queuing service adds the messages in sequential order.
AWS SQS is a highly scalable solution that allows applications to add and read messages, which makes decoupling the application more efficiently. AWS SQS provides two types of Queues.
AWS SQS TYPES:
- Standard Queue
- FIFO Queue
Standard Queue:
Standard Queue is the default queue type provided by AWS.
It doesn’t restrict the number of transactions per second, and ensures that messages are delivered at least once. That means there may be duplicate messages that need to be handled in the application.

As you can see in the above diagram, we can see the messages can be duplicate and consumer needs to handle the duplication part.
FIFO Queue : (First In, First Out)
A FIFO queue maintains the order for delivery of messages. The name of the queue should have the suffix as “.fifo”. It restricts 300 transactions per second and ensure that messages are delivered exactly once. This type of queue is used in case of definite series of steps to be performed, so only ordered messages should receive for processing.

FEATURES OF AWS SQS :
HIGH AVAILABILITY: AWS SQS provides high availability for sending and receiving messages as they are stored on distributed servers.
AUTHENTICATION: For accessing queue, we need to have permissions at queue level. To access the queue, users can access it based on IAM (Identity and Access Management)
VISIBLE TIMEOUT: Once the message from the queue is read by a consumer, then it hides that, so no other consumer can get that message.
DELAY MESSAGES: While sending messages, we can configure the delay at queue level as well as at message level.
COST: AWS charges only for the API requests hat are made to SQS. No fixed costs.
Queue Attributes:
Default Visibility Timeout: It is used when the consumer receives the message and processes it so that no other consumer have that same message. Here we have two possible scenarios.
- Once the consumer processes the message successfully, the consumer deletes the message
- No delete call is being made until the visibility timeout expires, so the message will be available to receive a call.
Message Retention Period: It is used to retain the message in the queue. After the message retention period expired, the message will be deleted automatically. By Default, the message retention period is 4 days, and can be of 14 days maximum.
Maximum Message Size: The message size that queue will accept.
Delivery Delay: It refers to messages that are invisible to consumers for that specific period of time. The value can be between 0 and 15 minutes.
Receive Message Wait Time: It is used for long polling. It will help to reduce the cost of using SQS. By default, short pooling is configured in AWS SQS. This will enable the receive message request to query all servers and provide respective responses.
Redrive Policy: It is used to configure the DLQ (Dead Letter Queue). Redrive policy will add messages to dead letter queue after the messages are not successfully processed when maximum receive time is specified. To enable redrive policy, you need to set below:
- Dead Letter Queue (DLQ): This parameter will contain the name of the dead letter queue.
- Maximum Receives: It contains the count after which unsuccessful messages need to be added to dlq.