AWS Messaging (SQS, SNS, Kineses) Flashcards

1
Q

What is the default and max retention of messages in SQS?

A

4 days is the default, 14 days is the maximum

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

How big can SQS messages be?

A

Up to 256KB

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

True or False: SQS messages are deleted once consumed

A

False. The polling application must use DeleteMessage API to delete messages

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

Why would you use SQS?

A

To decouple applications from one another, to turn synchronous process async

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

We want to auto-scale our EC2 instances to handle more SQS messaging. What can we do?

A

We can create a CloudWatch metric on Queue length. We can then create a CloudWatch alarm that our ASG picks up to scale up our Instances

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

We want to limit who and what resources can write to SQS. What can we use?

A

SQS Access Policies

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

What is the SQS Message Visibility Timeout?

A

When a message is polled by a consumer, the message becomes invisible for a duration of time (e.g. it cannot be polled by other consumers)

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

An application is processing an SQS message but knows it cannot finish within the Visibility Timeout window, what can it do?

A

Hit the ChangeMessageVisibility API to get more time

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

What is SQS Long Polling?

A

When a consumer requests a message from the queue, if there are none in there, it can wait longer for messages to arrive through Long Polling

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

How can we make sure SQS messages are in order?

A

Enable a FIFO Queue

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

What is the SNS + SQS Fan Out Pattern?

A

Its where you use an SNS Topic to publish to multiple SQS’s so that individual applications/services have copies of their own messages. SQS also make sure we have no data loss with as retries, delays and data persistence

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

What must we do to make sure SNS can publish to SQS?

A

Modify the SQS access policy

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

We want to control what messages can be sent from our SNS Topics to our subcribers. What can we use?

A

We can use a JSON message filtering policy

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

What does the Kinesis Data Stream record consist of?

A

A sequence number, a partition key and data blob (up to 1 MB)

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

What is the difference between on-demand and provisioned capacity mode for Kinesis Streams?

A

On-demand mode allows you to scale automatically the number of shards in the data stream. Provisioned is specifying beforehand the amount of shards you would like

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

What is the use case for Kinesis Data Firehose?

A

Firehouse will write data for us automatically to destination services

17
Q

Which one supports replay capability: Kinesis Firehose or Streams?

A

Streams

18
Q

What is the purpose of the partition key in a Kinesis Stream record?

A

It routes the record to different shards of a data stream

19
Q

How do you scale SQS?

A

SQS scales automatically

20
Q

Does SQS visibility timeout prevent other consumers from processing the message?

A

Yes

21
Q

What limits the capacity in a Kinesis data stream?

A

The number of shards. Each shard allows for 1MB/s incoming data and 2MB/s outgoing data.

22
Q

True or false: We can increase Kinesis Stream shard read throughput by adding more consumers

A

False. The read throughput is fixed at 2 MB/s per shard

23
Q

We want to modify data in real-time before sending it to the consumer? What service can we use?

A

Kinesis Firehouse. We can attach a Lambda to it to process data

24
Q

What is the partition key in a Kinesis Data Stream shard?

A

The partition key sperates data in the data stream into shards

Kinesis uses the partition key to determine which shard owns which data record