SQS Flashcards

1
Q

What is the key difference between SQS and SQS FIFO? What impacts does this have on throughput?

A

SQS supports best effort ordering and messages may be delivered more than once. 10k/sec throughput

SQS FIFO is strictly ordered and each message will be delivered only once.Up to 3,000 messages per second with batching, or up to 300 messages per second

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In SQS, what is the maximum number of messages a consumer can receive at any one time?

A

10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If your visibility timeout is to low, what might you observe and what is the impact if it is to high?

A

If its to short, then we will likely see requests processed multiple times as its returned to the queue before the consumer has processed it. If its to long, there may be delays in reprocessing the message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the redrive policy and why is it desirable?

A

Defines the amount of times a message is sent back to the queue. It requires a dead letter queue to be set up. When the number of retries is exhausted, the message is sent to the DLQ. This stops a potentially faulty message from being redelivered over and over again.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

You have a situation where we get a notification from an application that an order has been received. We need to send this to the audit, billing and shipping systems. Each of these has its own SQS queue. How could you achieve this?

A

Publish the message to an SNS topic. Each of the SQS queues is a subscriber to the topic. This is SNS to SQS fanout.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

You have built a decoupled system using SQS. When the billing cycle comes around, the SQS costs are much higher than expected. On further investigation, you find your consumer application is calling SQS way to often and getting no data. What would you do and why>

A

Long polling would be ideal. You could slow down the application polling rate bu this would increase latency so not ideal. Long polling will allow the consumer to wait for a message to arrive on the SQS queue and process it as soon as it arrives. Can configure between 1 and 20 seconds with 20 being the default.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

You have built a decoupled architecture using SQS Standard. As a part of a promotion, you are expecting a 10x increase in traffic, What do you need to do to scale your SQS infrastructure?

A

Nothing. SQS will scale to 10k+ messages/second (std). You will need to make sure your application can handle the traffic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In SQS, whose responsibility is it to delete messages from the queue once they are consumed?

A

Yours - or rather the applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between the DelaySeconds and the VisibilityTimeOut parameters? Why would you use them?

A

Delay seconds delays the visibility of the message when it ARRIVES on the Queue. Visibility time out hides the message on the Queue at the time of CONSUMPTION.
Delay seconds creates a delay queue which is useful if we have a dependency on something with eventual consistency. Visibility timeout prevents multiple consumers from processing the same message.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why would you use AWS MQ over SQS?

A

If you have an existing app using Apache MQ which you need to migrate without changing code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When setting up an AWS MQ interfaces, do you need to specify an instance type?

A

Yes and it will need to be based on estimated workloads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In an SQS queue, can you set a priority on individual messages?

A

No.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In a FIFO SQS queue - can you set a per message delay - i.e. a DELAYSECONDS for each message?

A

No. You can only do this at queue level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is content de-duplication? Which queue does it apply to, how does it work and what frequency does it run at?

A

Only applies to FIFO queues and occurs every 5 minutes. This removes duplicate messages from the queue when set and compares a hash of the message against hashes of those on the queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

You are designing a consumer application for SQS. In some cases, a messages may take longer than expected to process, but you don’t want to change the visibility time-out for the entire queue to accommodate these edge cases. What can you do?

A

The visibility time-out can be changed dynamically during processing via the consumer making a call to the change visibility time-out API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the 3 parts of an SQS message and what are the limits in size for each of these?

A
Message Headers
Message Body (256K)
Delay attributes (optional)
17
Q

3 things are returned to the producer by SQS when posting a message. What are they and what format are they in?

A

A message identifier
An MD5 hash of the body
An MD5 hash of the headers

18
Q

There are 3 types of SQS queues (excluding FIFO). What are they?

A

SQS Standard
SQS Delay
SQS Dead Letter

19
Q

What are the default and maximum retention periods in SQS?

A

4 and 14 days respectively