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

1
Q

What does “decoupling” mean in “decoupling applications”?

A

Decoupling refers to app components remaining autonomous and unaware of each other as they do their work

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

;What are the two patterns of application communication?

A

1) Synchronous communication (app to app)
2) Asynchronous / Event based communication (application to queue to application)

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

When can Synchronous communication become problematic and what is the solution?

A

Synchronous communication can become problematic if there are sudden spikes in traffic. The solution is to decouple your application

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

What is SQS Queue?

A

SQS is a distributed message queue that can reliably queue messages, with one component consuming messages that are produced by another

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

In terms of SQS Queue, what is a producer?

A

A producer is what sends messages to the queue (like an API)

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

In terms of SQS Queue, what is a consumer?

A

A consumer is what receives messages from the queue, reading and deleting them

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

What types of issues does a queue resolve, and how does it do so?

A

By acting as a buffer between applications, the queue resolves issues such as:
1) Producer is producing work faster than consumer can handle
2) Issues arising from intermittent network connectivity of either the producer, consumer, or both

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

What is SQS queueing used for?

A

SQS queueing is used for decoupling application components so they can run independantly.

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

Are SQS queues push or pull based?

A

SQS Queues are pull based, not pushed base. This means someone or something needs to be consuming the messages.

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

How long do SQS messages persist?

A

A Consumer message persists in SQS until a consumer deletes it

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

What are some common SQS consumers?

A

EC2 instances & Lambda functions are common SQS consumers

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

How can you save on SQS consumer costs?

A

Use the DeleteMessage API to delete messages after processing them.

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

How do consumers receive messages from SQS?

A

Consumers have to poll the SQS queue, and can only receive up to 10 messages at a time.

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

What is a very common application architecture using SQS, and why is it beneficial?

A

An extremely common architecture is to use SQS to decouple a backend and frontend. This improves reliability and performance by allowing us to scale the backend and frontend independently.

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

What is a very common application architecture using SQS, and why is it beneficial?

A

An extremely common architecture is to use SQS to decouple a backend and frontend. This improves reliability and performance by allowing us to scale the backend and frontend independently.

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

What are the two SQS queue types?

A

1) SQS Standard Queues (default)
2) SQS FIFO (First in First Out) Queues

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

SQS Standard Queue has what characteristics?

A

1) Almost unlimited TPS, automatic scaling
2) Guarantees a message is delivered at-least once
3) Can have out of order messages, even though it uses best-effort ordering (app should be able to cope with this)

17
Q

SQS FIFO Queue has what characteristics?

A

1) Message Order is strictly preserved
2) Exactly-once processing (no duplicate messages)
3) Max 300 TPS

18
Q

What are the minimum, maximum, and default SQS message retention periods?

A

Minimum: 1 minutes
Maximum: 14 days
Default: 4 days

19
Q

What is the SQS Message Visibility Timeout?

A

After a message is polled by a consumer, it becomes invisible to other consumers

20
Q

What happens if a message cannot be processed within the visbility timeout?

A

The message will be processed twice, or the consumer could call ChangeMessage Visibility API to get more time

21
Q

What might occur is visibility timeout is low? What if its high?

A

If the visibility timeout is low (seconds) we may get duplicates. If it is high (hours), a consumer crashing would mean a long re-processing period.

22
Q

What is the dead letter queue?

A

the dead letter queue (DLQ) is where messages go after they have gone back into the queue too many times.

23
Q

What is long polling?

A

Long polling = a consumer optionally waits for messages to arrive to the queue if there are currently none in the queue

24
Q

How does Long polling save money?

A

It saves money on polling costs by reducing API calls, latency, and reduces the number of empty responses.

25
Q

What is Amazon SNS

A

SNS = Simple notification service, a service that uses a publisher. subscriber system to push messages to many receivers.

26
Q

How does SNS work?

A

An event producer sends messages to an SNS topic, which then has many event receivers (subscribers) listening for the SNS topic notification.

27
Q

What type of services can be SNS topic subscribers?

A

Lambda, HTTP/HTTPs endpoints, SQS, Emails, SMS / mobile notifications, etc.

28
Q

What does “fan out” mean in relation to SNS?

A

“fanning out” is when an SNS topic can deliver notifications to many downstream subscribers of different types (SQS, Lambda, Email, etc.)

29
Q

What is an SNS topic?

A

An SNS topic is an access point for subscribers to all receive notifications. One topic can deliver to multiple endpoint types (IOS vs Android etc.) with each getting the message in the proper format

29
Q

What is an SNS topic?

A

An SNS topic is an access point for subscribers to all receive notifications. One topic can deliver to multiple endpoint types (IOS vs Android etc.) with each getting the message in the proper format

30
Q

What are the main benefits of SNS?

A

1) Instantaneous and push-based (no need for polling)
2) Flexible delivery over multiple transport protocols
3) inexpensive pay as you go system

31
Q

Describe the SNS + SQS fan out architectural pattern and its main use case

A

SNS topic as the producer pushes to multiple subscriber SQS queues (fanning out). This is a fully decoupled architecture with no data loss. The main use case is for sending the same S3 event type (like create object) to many SQS queues

32
Q

What is Amazon Kinesis?

A

Kinesis is a platform to load and analyze streaming data, making it easy to collect, process and analyze streaming data in real time.

33
Q

What are the four (4) Kinesis platforms?

A

1) Kinesis Data Streams
2) Kinesis Firehose
3) Kinesis Data Analytics
4) Kinesis Video Streams

34
Q

What is a Data Streaming?

A

A data stream = data that is generated continuously, from many sources, but sent simultaneously, in small sizes.

35
Q

What does Kinesis Video Streams do?

A

Kinesis Video Streams allows you to stream video content from connected devices to AWS for analytics, ML, and other processing.

36
Q

What is Kinesis Data Streams?

A

Kinesis Data Streams is scalable, durable, low-latency real time data streaming and ingestion at scale.

37
Q

How do you scale Kinesis Data Streams?

A

Kinesis Data Streams scales with sharding. There is one shard per type of data source. More shards gives more throughput, but is also more expensive.

38
Q

What does Kinesis Firehose do?

A

Kinesis Firehose allows you to load data into other AWS services and store data into target destinations.

39
Q

When moving to cloud, instead of re-engineering to use SQS or SNS, what service should be used?

A

Amazon MQ

40
Q

What does Kinesis Data Analytics allow you to do?

A

Kinesis Data Analytics allows you to perform real time analytics on data streams using SQL. Useful for real time dashboards and metrics.