Decoupling Applications: SQS, SNS, Kinesis, Active MQ Flashcards

1
Q

What is the different between synchronous and asynchronous communication?

A

In synchronous communication, applications talk to each other in real time and are tightly coupled.
In asynchronous communication, applications use a queue or middleware in between themselves to decouple themselves from each other.

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

Why can decoupling be useful?

A

If all applications are tightly coupled, a sudden spike in traffic can result in the receiving application being overwhelmed and unable to handle all of the requests.

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

What is Amazon SQS?

A

Simple Queuing Service, used to decouple applications through the use of a queue

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

What is the limit of messages in an SQS queue?

A

There is no limit

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

What is the maximum and default retention of messages in an SQS queue?

A

Max = 14 days
Default = 4 days

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

What type of delivery do SQS queues have? What does this mean?

A

“At least once” delivery - this means that the message is delivered at least once, but since messages are only deleted once they have been processed, the same message can be processed by two different consumers at once

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

What is used to regulate access to the SQS API?

A

IAM policies

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

What is SQS message visibility timeout?

A

A set period of time for which a message is made ‘invisible’ to consumers so that it is not polled directly after being polled by a different consumer

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

What can a consumer do if it knows it needs more time to process a message it has polled from the SQS queue?

A

It can increase the message visibility timeout through the use of an API

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

What are the risks of setting the message visibility timeout to being too short or too long?

A

Too short: the messages will be consistently processed by more than 1 consumer which is inefficient
Too long: if a consumer crashes the message won’t be processed for a long period of time

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

What is long polling in SQS?

A

When a consumer increases how long it waits for a message while connected to the queue if there are no messages in it. Once a message comes in, the consumer goes and processes it

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

Why is long polling advantageous?

A

It reduces the number of API calls made to SQS while increasing the efficiency and reducing latency of the application

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

What does FIFO stand for?

A

First-in, first-out

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

What is the 1 positive and 1 negative of FIFO queues?

A

Positive: exactly-once delivery - no need to worry about duplicate processing
Negative: decreased throughput

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

What model does SNS work off? What does this mean?

A

Publish/Subscription model - multiple subscribers receive messages as and when they are published by a publishing source

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

Do subscribers get all published messages for topic they are subscribed to?

A

Yes, unless they filter them

17
Q

What is the fan out pattern? What services are included and why is this useful?

A

The fan out pattern is used if you want to send messages en masse to SQS queues.
You subscribe all the SQS queues to an SNS topic and then they proliferate out from there.
This is much easier than manual integration and is a fully decoupled architecture.

18
Q

What are the 4 Kinesis services?

A

Data Streams
Data Firehose
Data Analytics
Video Streams

19
Q

What is Kinesis Data Streams made for?

A

Streaming big data into your systems

20
Q

What are the two capacity modes for Kinesis Data Streams?

A

Provisioned and on-demand

21
Q

How are Kinesis Data Streams streams scaled?

A

More shards are added if more capacity is needed

22
Q

What is Kinesis Data Firehose?

A

A service that batch writes data from producers into destinations both inside and outside of AWS. Near real time. Fully managed.

23
Q

Does Kinesis Data Firehose or Kinesis Data Streams have data storage?

A

Data Firehose does not
Data Streams does, up to 365 days of replayability

24
Q

Is Kinesis Data Firehose or Kinesis Data Streams real time?

A

Data Firehose is not
Data Streams is

25
Q

When would you use Kinesis for data ordering over SQS and vice versa?

A

Kinesis would be used when you have larger amounts of data.
SQS FIFO is better if you want to dynamically adjust the number of consumers you will use.

26
Q

What is Amazon MQ?

A

A managed service for customers already using RabbitMQ or ActiveMQ - these are open-source message broker services.
MQ has both queue and topic features in one broker.