Section 14: Decoupling applications: SQS, SNS, Kinesis Flashcards

1
Q

You are preparing for the biggest day of sale of the year, where your traffic will increase by 100x. You have already setup SQS standard queue. What should you do?
A) Open a support ticket to pre-warm the SQS queue
B) Enable auto scaling in the SQS queue
C) Increase the capacity of the SQS queue
D) Do nothing, SQS scales automatically

A

D) Do nothing, SQS scales automatically

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
You would like messages to be processed by SQS consumers only after 5 minutes of being published to SQS. What should you do?
A) Increase the DelaySeconds parameters
B) Change the Visibility Timeout
C) Enable Long Polling
D) Use the extended SQS client
A

A) Increase the DelaySeconds parameters

Delay queues let you postpone the delivery of new messages to a queue for a number of seconds. If you create a delay queue, any messages that you send to the queue remain invisible to consumers for the duration of the delay period. The default (minimum) delay for a queue is 0 seconds. The maximum is 15 minutes

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

Your consumers poll 10 messages at a time and finish processing them in 1 minute. You notice that your messages are processed twice, as other consumers also receive the messages. What should you do?
A) Enable Long Polling
B) Add delay to the messages when being produced
C) Increase the Visibility Timeout
D) Decrease the Visibility Timeout

A

C) Increase the Visibility Timeout

Immediately after a message is received, it remains in the queue. To prevent other consumers from processing the message again, Amazon SQS sets a visibility timeout, a period of time during which Amazon SQS prevents other consumers from receiving and processing the message. Increasing the timeout gives more time to the consumer to process that message and will prevent duplicate readings of the message

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

Your SQS costs are extremely high. Upon closer look, you notice that your consumers are polling SQS too often and getting empty data as a result. What should you do?
A) Decrease the number of consumers
B) Enable Long Polling
C) Increase the Visibility Timeout

A

B) Enable Long Polling

Long polling helps reduce the cost of using Amazon SQS by eliminating the number of empty responses (when there are no messages available for a ReceiveMessage request) and false empty responses (when messages are available but aren’t included in a response)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
You'd like your messages to be processed exactly once and in order. Which do you need?
A) SQS Standard Queue
B) SQS Dead Letter Queue
C) SQS Delay Queue
D) SQS FIFO Queue
A

D) SQS FIFO Queue

FIFO (First-In-First-Out) queues are designed to enhance messaging between applications when the order of operations and events is critical, or where duplicates can’t be tolerated. FIFO queues also provide exactly-once processing but have a limited number of transactions per second (TPS).

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

You’d like to send a message to 3 different applications all using SQS. You should
A) Use SQS Replication Feature
B) Use SNS + SQS Fan Out pattern
C) Send messages individually to 3 SQS queues

A

B) Use SNS + SQS Fan Out pattern

This is a common pattern as only one message is sent to SNS and then “fan out” to multiple SQS queues

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

You have a Kinesis stream usually receiving 5MB/s of data and sending out 8 MB/s of data. You have provisioned 6 shards. Some days, your traffic spikes up to 2 times and you get a throughput exception. You should
A) Enable Kinesis replication
B) Add more shards
C) Use SQS as a buffer to Kinesis

A

B) Add more shards

Each shard allows for 1MB/s incoming and 2MB/s outgoing of data

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

You are sending a clickstream for your users navigating your website, all the way to Kinesis. It seems that the users data is not ordered in Kinesis, and the data for one individual user is spread across many shards. How to fix that problem?
A) There are to many shards, you should only use 1 shard
B) You should use a partition key that represents the identity of user
C) You shouldn’t use multiple consumers, only one and it should re-order data

A

B) You should use a partition key that represents the identity of user

By providing a partition key we ensure the data is ordered for our users

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

We’d like to perform real time analytics on streams of data. The most appropriate product will be
A) SQS
B) SNS
C) Kinesis

A

C) Kinesis

Kinesis Analytics is the product to use, with Kinesis Streams as the underlying source of data

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

We’d like for our big data to be loaded near real time to S3 or Redshift. We’d like to convert the data along the way. What should we use?
A) SQS + Lambda
B) SNS + HTTP Endpoint
C) Kinesis Streams + Kinesis Firehose

A

C) Kinesis Streams + Kinesis Firehose

This is a perfect combo of technology for loading data near real-time in S3 and Redshift

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

You want to send email notifications to your users. You should use
A) SQS with Lambda
B) SNS
C) Kinesis

A

B) SNS

Has that feature by default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
You have many microservices running on-premise and they currently communicate using a message broker that supports the MQTT protocol. You would like to migrate these applications and the message broker to the cloud without changing the application logic. Which technology allows you to get a managed message broker that supports the MQTT protocol?
A) SQS
B) SNS
C) Kinesis
D) Amazon MQ
A

D) Amazon MQ

Supports JMS, NMS, AMQP, STOMP, MQTT, and WebSocket

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