Integration and Messaging Flashcards

(37 cards)

1
Q

Describe the Synchronous and Asyncronous application communication patterns

A

Synchronous - Application to Application
Asynchronous - Application to queue to Application (Event based)

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

Which model does each of the following services use:
1. SQS
2. SNS
3. Kinesis

A

SQS - Queue
SNS - Pub/sub
Kinesis - Real-time streaming

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

What shoulkd be the first service that comes to your mind when you think of decoupling applications?

A

SQS

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

What are two properties of the delivery of messages within SQS to consider?

A

Can have duplicate and out of order messages

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

Suppose you have configured an SQS queue and have EC2 instances downstream consuming messages. How can you ensure you have enough EC2 instances to handle the throughput of mesasges?

A

Use an ASG with scaling based on CloudWatch Metric - Queue Length

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

If you have an EC2 instance in one account that needs to access an SQS queue in the other, what must you create?

A

A cross account policy attached to the SQS queue

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

If you want S3 to be able to publish event notifications to SQS queue, what must you do?

A

Create a cross account policy and attach it to theSQS queue

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

What is Message Visibility Timeout and what is its default value?

A

The duration (by default 30 seconds) of which a message becomes invisible to other consumers once it is polled by a consumer

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

What is a Dead Letter Queue and how can messages be sent there?

A

It is where messages that have exceeded the MaximumRecieves threashhold are sent

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

What is the relation between the type of the DLQ and SQS queue?

A

They must be the same

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

How are you able to trigger a DLQ message to be returned to the main queue?

A

By “redriving to source”

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

What is Long Polling in relation to SQS?

A

Allow the consumer to “wait” until a message is recieved into the queue after polling. This reduces the number of API calls and decreases latency.

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

Given the limitation of 256kb of data in a SQS message, how would you send large messages?

A

Use the SQS extended client (library) which uses an S3 bucket alongside metadata messages in the queue to store large data

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

What do the following API related methods and paramters do in SQS
1. CreateQueue(MessageRetentionPeriod), DeleteQueue
2. PurgeQueue
3. SendMessage(DelaySeconds), RecieveMessage,DeleteMessage
4. MaxNumberOfMessages
5. RecieveMessageWaitTimeSeconds
6. ChangeMessageVisibility

A
  1. Create or delete a queue
  2. Delete all message in a queue
  3. Send (with a delay), recieve, or delete a message
  4. Limit how many messages will be polled at once by consumer
  5. Long polling
  6. Change message timeout
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Suppose you configure your SQS queue to FIFO, what is the impact on throughput and duplicate message?

A

Reduced throughput however messages will be in order using MessageGroup ID and deduplicated using DeduplicationID

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

What are the two methods to determine if a message is a duplicate in SQS FIFO?

A
  1. Content based - Uses SHA256 hash of message body
  2. Deduplication ID - Manually assign an ID
17
Q

How can you achieve parallel processing of an ordered subset of messages?

A

Specify common Message Group ID and define a different consumer per ID

18
Q

What service should you consider if you want to send a single message to multiple consumers? What pattern does this service use?

A

Consider SNS which uses a Pub/Sub pattern

19
Q

Describe how a message in SNS works?

A
  1. A message is published to an SNS topic
  2. Consumers that are “subscribed” to that SNS topic get the message
20
Q

How can you achieve the Fan Out pattern using SNS and SQS? What is one use case?

A
  1. Push a message from a producer to an SNS topic
  2. Message is recieved by the SQS queues that are subscribed to the topic

Usecase: For a single event type and prefix in s3 you can only have one S3 event rule. But what if you want to send the same s3 event to multiple sqs queues? Use fanout

21
Q

How would you achieve fanout with ordering and deduplication for SNS?

A

Create a SNS FIFO topic and have multiple subscrbed SQS FIFO queues

22
Q

What is an easy way to filter through messages in SNS?

A

Create a filter policy defined in a JSON document

23
Q

If you hear real time data, what AWS service should you think of?

A

Kinesis Data Streams

24
Q

If you hear near-real time data, what AWS service should you think of?

A

AWS Data Firehose

25
How can you guarentee ordering in Kinesis Data Stream?
Send data with the same Partition ID
26
Describe the following Capacity Modes for Kinesis Data Streams 1. Provisioned Mode 2. On-demand Mode
1. Provisioned Mode - Pick how many shards you want and scale manually - Pay per shard 2. On-demand Mode - Scales automatically - Pay per stream and data in/out
27
Why is Amazon Data Firehose considered "Near Real-Time"
It has a buffering capability based on size / time in which all the messages are sent at once to the destinations
28
Compare Kinesis Data Streams to Amazon Data Firehose in terms of real time vs near real-time
Kinesis Data Streams - Real time Amazon Data Firehose - Near real-time
29
Compare Kinesis Data Streams to Amazon Data Firehose in terms of data storage and replay capabiltiy
Kinesis Data Streams - Data storage up to 365 days and replayability Amazon Data Firehose - No data storage so no message replay
30
Where can flink NOT read from?
Amazon Data Firehose
31
Review this important SQS information :)
- Consumers "pull" data - Data is deleted once consumer - Can have many workers (consumers) - No need to provision throughput - Ordering guarentees only FIFO queue - Messages can be delayed on purpose
32
Review this important SNS information :)
- "Push" data to many subscribers - Data is not persisted - Pub/sub - No need to provision throughput - FIFO capabiltiy for SQS FIFO - Integrats with SQS for Fanout
33
Review this important Kinesis information :)
- Standard pattern "pulls" data - Enhanved-fan out "pushes" data - Can replay data - Meant for real time big data - Provisioned or on-demand capacity modes
34
Can Kinesis Data Firehose and Kinesis Data Streams be a subscriber to an SNS topic?
No! Only Data Firehose can be not Data Streams
35
Due to the spike in traffic, SQS consumers may fail multiple times while processing messages within the Visibility Timeou. What should you do to handle failed messages?
Add a Dead Letter Queue with a redrive policy
36
If you have an SQS FIFO queue with10 message groups, whats the maximum number of consumer that can consumer simultaniously?
10
37
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?
Shard Splitting