SQS, SNS Flashcards

1
Q

In SQS, what is message visibility timeout and what happens if this is too low or too high?

A

Message visibility timeout is the time in which the message will be “invisibile” to other consumers while being processed.
If it is too low, the message can be processed twice. If it is too high, re-processing messages will take time.
Consumers can call ChangeMessageVisibility if it knows the processing will take so much time

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

What is a Dead Letter Queue and when a message will be pushed there?

A

A dead letter queue is a SQS queue that will store messages that failed processing by the consumers. It is useful for debugging.
A message will be pushed to it when MaximumReceives threshold is reached. So, the message visibility timeout is reached, the message went back to the queue the number of times equal the MaximumReceives threshold, and then goes to the DLQ.

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

What is redrive to source SQS functionality?

A

Redrive to source functionality enables you to move the messages from DLQ to the source queue without much effort and without writing custom code.

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

What is long polling and why it is useful?

A

When long polling is enabled, the behavior of consumer polling messages from the queue changes. Instead of requesting many times when the queue is empty, if it requests one time and the queue is empty, it will wait until a message arrive and it is processed.
It is useful to reduce the amount of API calls made to the queue and latency of the application

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

What is extended client?

A

It is a library to support sending large mesasges to SQS. It stores the message on S3 and sends only a metadata to SQS. The consumer reads this metadata and retrieve the message from S3.

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

What is a FIFO queue and what is the difference between it and the standard queue?

A

On a FIFO queue, unlike the standard queue, the messages are processed in order by the consumer. It also has exactly-once send capability - removes duplicates and the throughput is limited.

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

What is deduplication on SQS and how it happens?

A

Deduplication can remove duplicated messages on a FIFO queue. It can check the message content (hash) and compare with incoming messages or it can provide a deduplication ID to be compared with.

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

What is message grouping on SQS?

A

Message grouping is a feature on SQS FIFO queue that enables you to create groups of messages that will be processed separately and each group will have its messages ordered and one consumer each.
It is useful when you need ordering on a subset of messages of a queue.

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

Explain the SNS + SQS fanout pattern

A

On this pattern, messages are published on SNS and SQS queues are subscribers of the SNS topic. (Similar to exchange - queue fanout rabbitmq pattern)

Use case - send S3 event to many SQS queues.

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

What is “hot partition” in Kinesis Data Stream?

A

A hot partition happens when a shard has much higher throughput than others. To avoid, you can choose a highly distributed partition key.

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

Why ProvisionedThroughputExceeded error happens in Kinesis Data Streams and how to fix it?

A

It happens when the input throughput of a shard exceeds the maximum. To fix it, ensure to have a highly distributed partition key, use retries with exponential backoff and increase shards (scale)

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

In Kinesis Data Stream, what is the difference between shared fan out consumer and enhanced fan out consumer?

A

On shared fan out consumer, the throughput of a shard is divided across all consumers. Adding consumers will decrease the throughput of other consumers.

On enhanced fanout consumers, each consumer of a shard has all the throughput available for itself. It is useful when you have a high number of consumers on a shard, but is expensive.

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

What is shard splitting and merging shards and why it is useful?

A

Shard splitting is used to increase stream capacity and divide a hot shard.
Merging shards is used to decrease stream capacity and group shard with low traffic

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

What is the difference between Kinesis Data Streams and Kinesis Firehose?

A

Kinesis Data Stream
* ingest data at scale
* write custom code of the producer and consumer
* data retention

Kinesis Data Firehose:
* load streaming data into S3 / redshift / opensearch, etc…
* fully managed
* no data storage

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

What is Kinesis Data Analytics?

A

Performs SQL statements on real time from Kinesis data stream or firehose data

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