SQS Flashcards
This deck aims to help retain concepts related to the SQS service.
Which AWS service provides a secure, durable, and highly available hosted queue that can integrate and decouple distributed software systems and components?
Amazon Simple Queue Service (SQS)
What are the two types of queues supported by SQS?
Standard and FIFO
What is the maximum size of an SQS message?
256 KB, but messages can include links to larger data
If VisibilityTimeout is set both on an SQS queue and on an individual message, which setting takes priority?
The setting applied to the message
Which SQS attribute can be configured (either on the queue or per message) to handle error correction and automatic reprocessing?
VisibilityTimeout (0 seconds to 12 hours)
This attribute specifies the time required for message processing by the client, if processing fails, the message becomes available for retry after the VisibilityTimeout period
What action must a client explicitly perform after successfully processing an SQS message?
The client must delete the message from the queue
Where are problematic SQS messages typically redirected for further analysis?
To a Dead-Letter Queue, which is configured to retain unsuccessfully processed messages for further investigation
What is the common integration pattern between SQS and Auto Scaling Groups (ASG)?
ASG can scale based on the length of the SQS queue
What integration does SQS support for serverless message processing?
SQS can invoke AWS Lambda functions when messages appear in the queue
What is the common integration pattern between SQS and SNS?
Fanout architecture, where a message sent to an SNS topic is received by multiple SQS queues subscribed to that topic, triggering message processing
What polling types are supported by SQS?
- Short-polling
- Long-polling
Which polling type immediately consumes requests and returns 0-10 messages?
Short-polling
In which polling type is if messages are available on the queue they will be received, and if not the request will wait for specified waitTimeSeconds (up to 20sec) for messages to arrive?
Long-polling, the more cost-effective approach
Does SQS support server-side encryption?
- SQS supports server-side encryption with AWS KMS for messages at rest
- SQS supports encryption in transit for messages transferred between SQS and clients
How is access to the SQS queue managed within AWS?
- Through identity-based policies within the same account
- Through resource-based policies (SQS Queue Policy) for access from external accounts
What is the billing model for the SQS service?
SQS is billed based on the number of requests, where one request can include 0-10 messages, and up to 64 KB of data
Which SQS queue type is the best effort and may deliver messages out of order?
Standard
Which SQS queue type guarantees at-least-once delivery?
Standard
Which SQS queue type offers better scaling with near-unlimited Transactions Per Second (TPS)?
Standard
Which SQS queue type is typically used for decoupling application components, worker pools, and batching for further processing?
Standard
Which SQS queue type guarantees message order?
FIFO
Which SQS queue type guarantees exactly-once delivery?
FIFO
Which SQS queue type provides 3,000 messages per second with batching, and 300 messages per second without batching?
FIFO
Which SQS queue type is used for workflow and command ordering?
FIFO
What suffix must be included in the SQS queue name when creating a FIFO queue?
The .fifo suffix (e.g. orders.fifo)
What trade-off is involved when choosing between SQS FIFO queues and SQS Standard queues?
Choosing FIFO queues sacrifices performance (compared to Standard queues) in favour of preserving message order
What SQS attribute can be used to delay the delivery of new messages to consumers for several seconds?
DelaySeconds (0 seconds to 15 minutes) attribute delays message visibility in the queue for the specified period before the messages become visible
If DelaySeconds is set both on the SQS queue and on an individual message, which setting takes priority?
The setting applied to the individual message
Is DelaySeconds attribute supported on SQS FIFO queues?
No, DelaySeconds is not supported on FIFO queues
Which AWS service is most suitable for implementing worker pools, decoupling, or asynchronous communication?
Amazon Simple Queue Service (SQS)
What configurations should be set for an SQS queue to redirect failed messages to a Dead-Letter Queue (DLQ)?
Configure a re-drive policy
DLQ should generally have a longer retention period than the original queue, and an alarm can be set up to notify about messages delivered to the DLQ
Which AWS service is the best choice when there is one producer group and one consumer group, with no need for persistence (messages are deleted after processing)?
Amazon Simple Queue Service (SQS)
If the ApproximateNumberOfMessagesVisible
metric for a target tracking scaling policy is not changing proportionally to the size of the Auto Scaling Group that processes messages, what alternative approach can be taken?
Utilize the backlog per instance metric with a target value based on the acceptable backlog per instance to maintain optimal processing
What are the best practices for making cost-effective use of SQS queues?
- Implement long polling
- Batch SQS API operations
What actions can be taken to delay the delivery of new messages to an SQS queue for a specified duration?
Create a Delay Queue (minimum delay = 0sec, maximum = 15min)
What is the difference between visibility timeout and delay queue in AWS SQS?
- In a delay queue, a message is hidden immediately upon being added
- With visibility timeout, a message is hidden only after it is consumed from the queue
For legacy applications processing multiple AWS SQS messages in a single thread, which polling strategy is the best option?
Short polling with the default visibility timeout
What parameter in AWS SQS specifies that a message belongs to a specific message group and ensures strict order processing within that group?
MessageGroupId
What parameter in AWS SQS is used to deduplicate messages, preventing delivery of messages with the same ID within a 5-minute interval?
MessageDeduplicationId
What is the maximum number of messages can be requested from AWS SQS queue?
Maximum 10 messages at a time
How can you extend a message’s visibility timeout in AWS SQS?
Use the ChangeMessageVisibility
action to extend a message’s visibility timeout (default 30s, minimum 0s, maximum 12h)