[DEVELOPER] SQS + SNS Flashcards

1
Q

Explain how SQS Extended Client works

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

Say you want to send a message through SQS of 1GB. How might you do this?

A

SQS Extended Client

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

Why is SQS Long Polling preferable to Short Polling?

A

increases efficiency and latency of the application by decreasing number of API calls made to SQS

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

What are the configuration limits for wait time for SQS Long Polling?

A

1-20 seconds, (but 20 seconds is preferred)

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

What is the name API-level field for configuring SQS Long Polling?

A

RecieveMessageWaitTimeSeconds

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

What does the SQS API call PurgeQueue do?

A

delete all messages in the queue

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

Suppose you are using an SQS/SNS fan-out pattern for an ordering service, but one of your SQS queues should only receive messages that are of the “placed” state. There are multiple SQS queues and you expect not all of your incoming messages will have a “placed” state. How can you implement this functionality?

A

Use SNS Message Filtering (aka fitler policies)

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

Suppose you want to send one S3 Event to many SQS queues. How can you do this in S3?

A

You cant do it in S3, because for each (event type, prefix) you can only have 1 S3 event rule

Instead Use SNS/SQS Fan-out (configure events to SNS)

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

Suppose you want to configure your messaging system to have ordering, deduplication, and fan-out. How can you accomplish this?

A

SNS FIFO Topic AND SQS FIFO Queue

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

Can Lambda subscribe to an SNS FIFO Queue?

A

NO

only SQS FIFO can subscribe to an SNS FIFO topic

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

What are the two methods for SQS FIFO deduplication?

A
  1. Explicit MessageDeduplicationID
  2. Content-based Deduplication (a SHA-256 of the message body)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Suppose you have an SQS queue in one account and an EC2 instance in another account that needs to poll from that SQS queue. How can you configure this to happen?

A

Apply an SQS Queue Policy on the queue to give ReceiveMessage permissions to the account with the EC2 instance

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

Suppose you want to publish an S3 event notification to an SQS queue. You check the SQS queue but the messages are not showing up there. What might you need to do?

A

Configure an SQS Queue Policy on the queue to give SendMessage permissions to the S3 Bucket

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

Suppose you want to send one S3 Event to many SQS queues. How can you do this?

A

Use SNS/SQS Fan-out (configure events to SNS)

S3 Event -> SNS -(fan out) -> SQS queues

Recall: for each (event type, prefix) you can only have 1 S3 event rule

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