Shrestha Rajat

Search

Search IconIcon to open search

Last updated Jul 9, 2023 Edit Source

# SQS

#aws #cloud #serverless #microservices #decoupleing #queue

First-ever AWS service that was made publicly available. (Oldest service).  Message Queue service enables web services applications to queue messages. Acts like a buffer between the components between different components and often used for decoupling different services. Can set up an Auto-scaling group to SQS which is a great practice. It can pick up messages using a “poll” and is mostly used for pull-based operations.

# Features

# Visibility Timeout

# Polling

Using S3 for large SQS message (256KB-2GB) (Amazon SQS Extended Client Library for Java, AWS SDK for java)

**

Fully managed queing services that enables you to decouple a big complex architecture to a simpler one. It is primarily for Application integration.

pull based.

Messege size can be between 1 byte to 256 KB

Extended storage option is availabe on Java SDK which allows storage of message upto 2GB but will be required to be stored in S3.

Message retention by default is 4 days

from min of 60 seconds to max of 14 days

# Standard Queues

Pasted image 20220724103848 Allows nearly-unlimited number of transactions per second using best effort ordering which can maintain the deleviry order and this type of queue guarantees that a message will be delivered at least once. Which means more than one copy of message could be potentially delivered out of order.

# FIFO Queue

Pasted image 20220724104025 Supports multiple ordered message groups within a single queue and will be limited to 300 transactions per second. If batched 10 messages per operation (max), can support upto 3000 messages. Have all of the capabilities of a standard queue and eliminates more than once processing.

# Standard vs FIFO

# Dead Letter Queue

To handle message failure, A DLQ will set aside the message which was not processed correctly. It can be either Standard Queues or FIFO Queue which will be specified as a DLQ to an existing SQS queue. SQS Delay Queue postpones delivery of new messages (makes them invisible)(0s-900s).

It only affects standard queues but it will affect the whole FIFO Queue. (e.g. for confirming the order in E-commerce).

# Delay Queue

A message could be hidden when created in SQS for some time.

# Visibility Timeout

To prevent another app from reading a message which is already being processed by another app. This help

# Polling

Short Polling vs Long Polling Pasted image 20220724104406

Pasted image 20220724104428