SQS Flashcards

1
Q

What does SQS stand for?

A

Simple Queue Service

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

What does AWS SQS do?

A

SQS is a pull-based, distributed queue system forproducer/consumer-typesystems

  • some applications add requests to the queue, other applications poll the queue for requests and execute them
  • Amazon SQS is a web service that gives you access to a message queue that can be used to store messages while waiting for a computer to process them.​
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In the context of SQS, what is a queue?

A

A temporary repository of messages that are awaiting processing

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

On the exam, when you see the word decouple, what should you immediately think about? Why?

A

SQS

SQS is used to decouple components of an application and ease message management btween them.

(SQS has been using terminology with decouple for a long time)

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

What was the very first service offered by AWS?

A

SQS

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

What is the maximum size of an SQS message?

A

256kb BUT you can go over this by storing payloads in S3

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

What are the two types of SQS queues?

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

What does TPS stand for?

A

Transactions Per Second

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

What is the TPS limit on an SQS standard queue?

A

nearly unlimited transactions per second

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

What are the main drawbacks of standard queues vs. FIFO queues?

A

Occassionally, becuase of the highly-distributed nature architechture that gives the high throughput:

  • (duplicates) more than one copy of a message might be delivered
  • (best-effort ordering vs. exactly-once processing) messages might be delivered slightly out of order, but are generally delivered in the same order in which they are sent

(With FIFO queues, you don’t get duplicates, and you get exactly-once processing and ordering is strictly preserved)

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

What is the TPS limit on FIFO queues?

A

300 TPS

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

How long can messages be kept in SQS?

A
  • Configurable from 1 minute to 14 days.
  • Default value is 4 days
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are message groups?

A
  • Messages are grouped into distinct, ordered “bundles” within a FIFO queue.
  • For each message group ID, all messages are sent and received in strict order. However, messages with different message group ID values might be sent and received out of order.
  • Every message must have a message group ID

(Source: https://aws.amazon.com/sqs/faqs/)

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

Can you have multiple producers for an SQS FIFO queue?

A

Yes. Messages are stored in the order that they were successfully received by Amazon SQS.

(Source: https://aws.amazon.com/sqs/faqs/)

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

Can you have multiple consumers for an SQS FIFO queue?

A
  • By design, Amazon SQS FIFO queues don’t serve messages from the same message group to more than one consumer at a time.
  • However, if your FIFO queue has multiple message groups, you can take advantage of parallel consumers, allowing Amazon SQS to serve messages from different message groups to different consumers

(Source: https://aws.amazon.com/sqs/faqs/)

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

What is visibility timeout?

A

In SQS, Visibility Timeout is the amount of time that a message is invisible in the SQS queue after a reader picks up the message.

  • If the job is processed within that time, it’s deleted from the queue
  • If not, the message becomes visible again and another reader can process it
17
Q

When using SQS, a message that you only meant to have processed once seems to have been processed twice! What might have happened? How might we be able to remediate?

A
  • You are using a standard queue, which means you could have duplicates. To remediate: Upgrade to a FIFO queue

OR

  • The visibility timeout of your message is too small, and it became visible again before the first reader was able to finish processing. To remediate: raise the visibility timeout
18
Q

What are the max/min/default values for visibility timeout?

A
  • Max: 12 hours
  • Min: 0 seconds
  • Default: 30 seconds

(Source: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)

19
Q

In general, does SQS guarantee that your message will be processed exactly once?

A

No. They guarantee that your message will be processed at least once

20
Q

What is the difference between SQS Short Polling and Long Polling?

A

The key difference is in how they handle the empty queue case

  • Short Polling returns immediately
  • Long Polling waits until a message arrives or it times out
21
Q

Does SQS automatically manage application-level tracking?

A

No, you need to set this up yourself

22
Q

What does the “DelaySeconds” attribute in SQS control?

A

When a new message is added to the SQS queue, it will be hidden from consumer instances for a fixed period.

23
Q

In the context of SQS, what is horizontal scaling?

A

Horizontal scaling involves increasing the number of message producers and consumers in order to increase your overall queue throughput