SQS, SNS, Kinesis Flashcards

1
Q

You have an e-commerce website and you are preparing for Black Friday which is the biggest sale of the year. You expect that your traffic will increase by 100x. Your website already using an SQS Standard Queue. What should you do to prepare your SQS Queue?

A. Contact AWS Support to pre-warm your SQS Standard Queue
B. Enable Auto Scaling in your 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

How would you configure your SQS messages to be processed by consumers only after 5 minutes of being published to your SQS Queue?

A. Increase the DelaySeconds parameter
B. Change the Visibility Timeout
C. Enable Long Polling
D. Use Amazon SQS Extended Client

A

A. Increase the DelaySeconds parameter

SQS Delay Queues is a period of time during which Amazon SQS keeps new SQS messages invisible to consumers. In SQS Delay Queues, a message is hidden when it is first added to the queue. (default: 0 mins, max.: 15 mins)

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

You have an SQS Queue where each consumer polls 10 messages at a time and finishes processing them in 1 minute. After a while, you noticed that the same SQS messages are received by different consumers resulting in your messages being processed more than once. What should you do to resolve this issue?

A. Enable Long Polling
B. Add DelaySeconds parameter to the messages when being produced
C. Increase Visibility Timeout
D. Decrease Visibility Timeout

A

C. Increase Visibility Timeout

SQS Visibility Timeout is a period of time during which Amazon SQS prevents other consumers from receiving and processing the message again. In Visibility Timeout, a message is hidden only after it is consumed from the queue. Increasing the Visibility Timeout gives more time to the consumer to process the message and prevent duplicate reading of the message. (default: 30 sec., min.: 0 sec., max.: 12 hours)

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

You have a fleet of EC2 instances (consumers) managed by an Auto Scaling Group that used to process messages in an SQS Standard Queue. Lately, you have found a lot of messages processed twice and after further investigation, you found that these messages can not be processed successfully. How would you troubleshoot (debug) why these messages fail?

A. SQS Standard Queue
B. SQS Dead Letter Queue
C. SQS Delay Queue
D. SQS FIFO Queue

A

B. SQS Dead Letter Queue

SQS Dead Letter Queue is where other SQS queues (source queues) can send messages that can’t be processed (consumed) successfully. It’s useful for debugging as it allows you to isolate problematic messages so you can debug why their processing doesn’t succeed.

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

Which SQS Queue type allows your messages to be processed exactly once and in order?

A. SQS Standard Queue
B. SQS Dead Letter Queue
C. SQS Delay Queue
D. SQS FIFO Queue

A

D. SQS FIFO Queue

SQS FIFO (First-In-First-Out) Queues have all the capabilities of the SQS Standard Queue, plus the following two features. First, The order in which messages are sent and received are strictly preserved and a message is delivered once and remains available until a consumer process and deletes it. Second, duplicated messages are not introduced into the queue.

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

You have 3 different applications that you’d like to send them the same message. All 3 applications are using SQS. What is the best approach would you choose?

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 where only one message is sent to the SNS topic and then “fan-out” to multiple SQS queues. This approach has the following features: it’s fully decoupled, no data loss, and you have the ability to add more SQS queues (more applications) over time.

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

You have a Kinesis data stream with 6 shards provisioned. This data stream usually receiving 5 MB/s of data and sending out 8 MB/s. Occasionally, your traffic spikes up to 2x and you get a ProvisionedThroughputExceededException exception. What should you do to resolve the issue?

A. Enable Kinesis Replication
B. Add more Shards
C. Use SQS as a buffer to Kinesis

A

B. Add more Shards

The capacity limits of a Kinesis data stream are defined by the number of shards within the data stream. The limits can be exceeded by either data throughput or the number of reading data calls. Each shard allows for 1 MB/s incoming data and 2 MB/s outgoing data. You should increase the number of shards within your data stream to provide enough capacity.

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

You have a website where you want to analyze clickstream data such as the sequence of clicks a user makes, the amount of time a user spends, and where the navigation begins, and how it ends. You decided to use Amazon Kinesis, so you have configured the website to send these clickstream data all the way to a Kinesis data stream. While you checking the data sent to your Kinesis data stream, you found that the users’ data is not ordered and the data for one individual user is spread across many shards. How would you fix this problem?

A. There are too many shards, you should only use one shard
B. You shouldn’t use multiple consumers, only one and it should re-order data
C. For each record sent to Kinesis add a partition key that represents the identity of the user

A

C. For each record sent to Kinesis add a partition key that represents the identity of the user

Kinesis Data Stream uses the partition key associated with each data record to determine which shard a given data record belongs to. When you use the identity of each user as the partition key, this ensures the data for each user is ordered hence sent to the same shard.

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

Which AWS service is most appropriate when you want to perform real-time analytics on streams of data?

A. SQS
B. SNS
C. Kinesis Data Analytics
D. Kinesis Data Firehose

A

C. Kinesis Data Analytics

Use Kinesis Data Analytics with Kinesis Data Streams as the underlying source of data.

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

You are running an application that produces a large amount of real-time data that you want to load into S3 and Redshift. Also, these data need to be transformed before being delivered to their destination. What is the best architecture would you choose?

A. SQS + AWS Lambda
B. SNS + HTTP Endpoint
C. Kinesis Data Streams + Kinesis Data Firehose

A

C. Kinesis Data Streams + Kinesis Data Firehose

This is a perfect combo of technology for loading data near real-time data into S3 and Redshift. Kinesis Data Firehose supports custom data transformations using AWS Lambda.

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

Which of the following is NOT a supported subscriber for AWS SNS?

A. Kinesis Data Streams
B. SQS
C. Lambda
D. HTTP(S) Endpoint

A

A. Kinesis Data Streams

Note: Kinesis Data Firehose is now supported, but not Kinesis Data Streams.

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

Which AWS service helps you when you want to send email notifications to your users?

A. SQS with Lambda
B. SNS
C. Kinesis

A

B. SNS

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

You have an SNS topic with 1000s of subscribers and you want to send some messages to certain subscribers and not others. What SNS feature allows you to do so?

A. SNS Message Filtering
B. SNS Access Policy
C. SNS FIFO Topic

A

A. SNS Message Filtering

SNS Message Filtering allows you to filter messages sent to SNS topic’s subscriptions.

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

You have an e-commerce website and you are preparing for Black Friday which is the biggest sale of the year. You expect that your traffic will increase by 100x. Your website already using an SQS Standard queue. Due to the spike in traffic, consumers may fail multiple times while processing messages within the Visibility Timeout, due to some constrains to the application database. What else should you do to handle failed messages?

A. Add an SQS filter to verify the message format
B. Implement a Dead Letter Queue (DLQ) with a redrive policy
C. Increase the Visibility Timeout

A

B. Implement a Dead Letter Queue (DLQ) with a redrive policy

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

Your SQS costs are extremely high. Upon closer look, you notice that your consumers are polling your SQS queues 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

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

SQS message size limit is 256 KB, but you want to send messages of 1 MB. You should:

A. Contact AWS Support to increase SQS Message Size Limit
B. Modify your SQS queue configuration and set the maximum message size to 2 MB
C. Use the SQS Extended Client Library

A

C. Use the SQS Extended Client Library

17
Q

You can configure an SQS queue to keep messages for a maximum of __ days.

A. 4 days
B. 7 days
C. 14 days
D. 30 days

A

C. 14 days

You can configure the Amazon SQS message retention period to a value from 1 minute to 14 days. The default is 4 days.

18
Q

Which SQS FIFO message attribute allows multiple messages belong to the same group to be processed in order?

A. MessageDeduplicationId
B. MessageGroupId
C. MessageHash
D. MessageOrderId

A

B. MessageGroupId

19
Q

Which SQS FIFO message attribute prevents messages with the same deduplication ID to be delivered during a 5-minutes period?

A. MessageDeduplicationId
B. MessageGroupId
C. MessageHash
D. MessageOrderId

A

A. MessageDeduplicationId

20
Q

A Kinesis Data Stream that you manage experiencing an increase in traffic due to a sale day. Your Kinesis Data Streams currently has 6 shards, and you have been asked to split shards to become 10 shards. You have been using a consuming application based on Kinesis Client Library (KCL) and are running on a set of EC2 instances. What’s the maximum number of EC2 instances that can be deployed to process the messages in shards?

A. 1
B. 6
C. 10
D. 20

A

C. 10

When using Kinesis Client Library, each shard is to be read-only by one KCL instance. So, if you have 10 shards, then the maximum KCL instances you can have is 10.

21
Q

You are running an SQS FIFO queue with 10 message groups (defined by MessageGroupID). What’s the maximum number of consumers can consume simultaneously?

A. 1
B. 10
C. 20
D. Infinite

A

B. 10

You can have as many consumers as “MessageGroupID” for your SQS FIFO queues.

22
Q

You can configure a Kinesis Data Stream to keep records for a maximum of ___ days.

A. 30 days
B. 90 days
C. 180 days
D. 365 days

A

D. 365 days

23
Q

You have a Kinesis Data Stream where you intermittently get a ProvisionedThroughputExceededException exception in your producers’ applications. The following can be used to resolve the error, EXCEPT ____ .

A. Use a highly distributed partition key
B. Retry with exponential backoff
C. Contact AWS Support to increase your Kinesis Data Stream’s capacity
D. Add more shards

A

C. Contact AWS Support to increase your Kinesis Data Stream’s capacity

24
Q

What should you use to increase the read throughput for Kinesis Data Streams consumers up to 2 MB/s per consumer per shard?

A. Classic Fan-out Consumer
B. Enhanced Fan-out Consumer
C. Kinesis Producer Library (KPL)
D. AWS SDK

A

B. Enhanced Fan-out Consumer

25
Q

You have a hot shard in a Kinesis Data Stream, thus causing many ProvisionedThroughputExceededException exceptions. What operation allows you to increase the number of shards?

A. Shard Splitting
B. Merge Shards
C. Nothing, Kinesis Data Stream scales automatically

A

A. Shard Splitting