Chpater 11 Refactor to Microservices Flashcards

1
Q

Explain AWS SQS at a high level

A

Simple Queue Service. It temporarily stores messages from a provider while it waits for a message producer to process the message.

Messages are stored passively (no notification)

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

What are the limits to the number of producers and consumers for SQS?

A

There are no limits. SQS is a distributed cluster of servers.

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

List states of SQS message

A
  1. Sent to queue by a producer
  2. Received from queue from a consumer
  3. Deleted from queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an ‘in-flight’ state for an SQS message?

A

When a message is b/t states of received and deleted. There are a finite number of in-flight messages that can be processed.

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

What is ‘Long-Polling’ in SQS and how do you implement it?

A

Method to reduce operational cost of SQS by eliminating empty responses.

Achieved by setting longer time intervals for the ‘ReceiveMessage’ action (max is 20 seconds, min is 1 second)

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

What is the ‘VisibilityTimeout’?

A

SQS actions which is the duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ‘ReceiveMessage’ request.

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

If you find yourself setting the VisibilityTimeout action in SQS to longer than 12 hours, what should you consider doing instead?

A

Use AWS Step Functions

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

What is a ‘Dead Letter Queue’?

A

A queue/dump where failed messages are stored. For example, a user order item with a deleted product ID. Associated message can be sent to the dead letter queue.

Useful for:

  • configuring alarm for any messages received in DLQ
  • analyze contents of problematic messages
  • determineif you gave consumer sufficient processing time
  • DLQ must be FIFO when used w/ SQS FIFO queue
  • DLQ must be standard when used w/ SQS Standard Queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

SQS Standard Queues ensure scalability and throughput by having what two tradeoffs?

A
  • order is not guaranteed

- messages can appear twice

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

What is alternative to SQS Standard Queues?

A

SQS FIFO queues:

  • provide ordered messages
  • delete any duplicates that appear in queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

With Kinesis Data Streams, how/when are messages/records deleted?

A

Via a retention interval expiration, which you configure

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

How to support high throughput in Kinesis Data Streams?

A

Increase number of shards in Kinesis Data Stream system

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

Difference b/t Kinesis Firehose and Kinesis Data Streams?

A

Higher level. Firehose does not require you to write a consumer application.

Also Firehose handles dynamic scaling of underlying shards and automatically delivers data to services like S3, Redshift, etc.

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

AWS Kinesis Data Analytics

A

Allows you to process and analyze streaming data with SQL. Good for performing time series analytics, feed real time dashboards, create real time metrics.

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

For Kinesis Streams, what is data made of?

A
  1. ‘data blobs’ of up to 1MB attached to a…
  2. ‘record key’ (metadata to tell which shard to go to)
  3. sequence #
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

DynamoDB Streams

A

Event pool which receives dynamoDB events from CRUD actions. Often integrated with Lambda via ‘triggers’

17
Q

At any given time, each partition in an Amazon DynamoDB table maps to a single ______ which captures all updates to that partition.

A

shard

18
Q

What is connector b/t IOT devices and AWS Services?

A

Rules Engine

*no retry or delivery guarantees for messages

19
Q

What protocols can devices use to communicate w/ AWS IOT?

A
  1. MQTT Message Queuing Telemetry Transport

2. HTTP

20
Q

AWS IOT Message Broker

A

pub/sub broker service for messages to and from IOT devices. No cross region / cross account capabilities

21
Q

How to represent and communicate with offline device in AWS?

A

via AWS IOT device shadow

22
Q

What is AWS’s managed message broker service which is compatible with many popular message brokers?

A

Amazon MQ

23
Q

With Step functions, built in 1. _____, 2.____, and 3.____ capabilities deal with errors and exceptions automatically

A
  1. try/catch
  2. retry
  3. rollback
24
Q

Step functions implement basic primitives such as ____, ___, and ___.

A

branching, parallel execution, timeouts

25
Q

What is language used to control step functions?

A

Amazon States Language

26
Q

List all functions for step functions

A

Task state: Performs work in your state machine

Choice state: Makes a choice between branches of execution

Fail or Succeed state: Stops an execution with a failure or success

Pass state: Passes inputs to outputs or inject corrected data

Wait state: Provides a delay for a certain amount of time or until a specified time/date

Parallel state: Begins parallel branches of execution

27
Q

If a parallel branch in a step function fails, can you stop a running Lambda function?

A

no

28
Q

How to stop long running activities in parallelized step function?

A

check heartbeat to detect whether step functions has stopped its branch

29
Q

In step functions each step defines either a ____ or a ____.

A
  1. next state

2. end state

30
Q

In the Amazon States Language, three components filter and control the flow of JSON from state to state: 1.____, 2._____, and 3._____.

A
  1. InputPath
  2. OutputPath
  3. ResultPath
31
Q

Size of SQS message?

A

256kb

32
Q

Size of SNS message?

A

256kb

33
Q

You have an Amazon Kinesis data stream with one shard and one producer. How many consumer applications can you consume from the stream?

A

Limitless number of consumers as long as all consumers consume fewer than 2 MB and five transactions per second